Hello!,
I am using Ax2012.
I am trying to create and post general ledger journal with financial dimensions Value but i am getting an error as Financial dimension value does not exist.
I Have given my code please help me solve the issue.
static void LearningGeneralJournal(Args _args)
{
AxLedgerJournalTable journalTable;
AxLedgerJournalTrans journalTrans;
container acctPattern;
container offSetAcctPattern;
LedgerJournalTable ledgerJournalTable;
LedgerJournalTrans ledgerJournalTrans;
ledgerJournalCheckPost ledgerJournalCheckPost;
journalTable = new AxLedgerJournalTable();
journalTrans = new AxLedgerJournalTrans();
//Journal Name
journalTable.parmJournalName("GenJrn");
journalTable.save();
journalTrans.parmJournalNum(journalTable.ledgerJournalTable().JournalNum);
journalTrans.parmTransDate(systemDateGet());
journalTrans.parmCurrencyCode("USD");
journalTrans.parmAmountCurDebit(200);
journalTrans.parmAccountType(LedgerJournalACType::Ledger);
acctPattern = ["420100", "420100",2,"Agreement","OU_3566","Training"];
journalTrans.parmLedgerDimension(AxdDimensionUtil::getLedgerAccountId(acctPattern));
journalTrans.parmOffsetAccountType(LedgerJournalACType:: Ledger );
offSetAcctPattern = ["0101", "0101",0,"00000036","OU_3566","Training"];
journalTrans.parmOffsetLedgerDimension(AxdDimensionUtil::getLedgerAccountId(offSetAcctPattern));
journalTrans.save();
ledgerJournalCheckPost = ledgerJournalCheckPost::newLedgerJournalTable(journalTable.ledgerJournalTable(),NoYes::Yes);
ledgerJournalCheckPost.run();
info(strFmt("Journal No. %1.", journalTable.ledgerJournalTable().JournalNum));
}
I couldnt able to find the financial dimension value.
Thanks.