Hi guys, Today we see how to create General Journal line in Ax 2012 or D365 FO.
Here we are using 2 classes.
AxLedgerJournalTable axLedgerJournalTable ;
AxLedgerJournalTrans axLedgerJournalTrans;
axLedgerJournalTable.parmJournalName(_Name);
axLedgerJournalTable.save();
axLedgerJournalTrans.parmJournalNum(axLedgerJournalTable.ledgerJournalTable().JournalNum);
axLedgerJournalTrans.parmTransDate(systemDateGet());
axLedgerJournalTrans.parmCurrencyCode('USD');
axLedgerJournalTrans.parmTxt(_Description);
axLedgerJournalTrans.parmAmountCurDebit(_Debit);
axLedgerJournalTrans.parmExchRate(Currency::exchRate('USD'));
axLedgerJournalTrans.parmAccountType(str2enum(LedgerJournalACType,_AccountType));
accPattern = ['110110','110110',2,'BusinessUnit',"001","Department","022"];
axLedgerJournalTrans.parmLedgerDimension(AxdDimensionUtil::getLedgerAccountId(accPattern));
offSetPattern = ['112140',"112140",2,'BusinessUnit','003',"Department","024"];
axLedgerJournalTrans.parmOffsetLedgerDimension(AxdDimensionUtil::getLedgerAccountId(offSetPattern));
axLedgerJournalTrans.save();
Keep Daxing!!
No comments:
Post a Comment