ALLOW CUSTOMER AND VENDOR ACCOUNT TYPES:
Microsoft has code some hardcoded limitation in the class LedgerJournalTransType method validateAccountType and validateOffsetAccountType. Simply remove the AifFault::checkFailedLogFault line and it will work again.
GET IN CONTROL WITH VOUCHERS:
In case the voucher Num sequence is set on manual, you have to add the voucher in the XML message. But there are some quite annoying implementation choices made by the AX 2009 developers’ team. Look in class LedgerJournalTransType method defaultVoucher. The field gets unattached and cleared. Next it calls the method determineDefaultVoucher and this will trigger the numbersequence. In case it was a manual numbersequence your value was lost by processing the defaultVoucher method.
CREATE NON DAILY JOURNALS
You need to create new derived classes from the class LedgerJournalTableType overload the methods:
• defaultJournalType
• isJournalNameValidJournalType
• new
• construct
Also remove the limitation of the method initQuery in the AxdLedgerGeneralJournal class Also add this new class in the construct of the LedgerJournalTableType class.
INVOICE REGISTRATION
Create a new derived class for LedgerJournalTableType
protected void new(AxLedgerJournalTable _axLedgerJournalTable, LedgerJournalOperation _operation, boolean _isInteractiveContext)
{
;
Debug::assert(_operation == LedgerJournalOperation::Create);
axLedgerJournalTable = _axLedgerJournalTable;
ledgerJournalTable = axLedgerJournalTable.ledgerJournalTable();
operation = _operation;
isInteractiveContext = _isInteractiveContext;
}
protected boolean isJournalNameValidJournalType()
{
boolean journalTypeIsValid;
;
if (ledgerJournalName.RecId != 0)
{
journalTypeIsValid = (ledgerJournalName.JournalType == LedgerJournalType::PurchaseLedger);
}
else
{
journalTypeIsValid = false;
}
return journalTypeIsValid;
}
protected void defaultJournalType()
{
if (operation == LedgerJournalOperation::Create)
{
ledgerJournalTable.JournalType = LedgerJournalType::PurchaseLedger;
axLedgerJournalTable.setFieldAsTouched(fieldnum(LedgerJournalTable,JournalType));
}
}
public static LedgerJournalTableType_PurchaseLedger construct(AxLedgerJournalTable _axLedgerJournalTable, LedgerJournalOperation _operation, boolean _isInteractiveContext)
{
LedgerJournalTableType_PurchaseLedger ledgerJournalTableType_PurchaseLedger;
;
ledgerJournalTableType_PurchaseLedger = new LedgerJournalTableType_PurchaseLedger(_axLedgerJournalTable, _operation, _isInteractiveContext);
return ledgerJournalTableType_PurchaseLedger;
}
Also the default ledger account of the vendor posting profile needs to be added to the prepeare for save method of the AxdLedgerGeneral class
if(axLedgerJournalTable.parmJournalType() == LedgerJournalType::PurchaseLedger &&
axLedgerJournalTrans.parmAccountType() == LedgerJournalACType::Vend)
{
axLedgerJournalTrans.parmOffsetAccountType(LedgerJournalACType::Ledger);
axLedgerJournalTrans.parmOffsetAccount(
VendLedgerAccounts::purchLedgerOffsetAccount(axLedgerJournalTrans.parmAccountNum()));
}