I am new in coding and i need a help .
I have this code as below
AxLedgerJournalTable journalTable;
AxLedgerJournalTrans journalTrans;
container accCon;
container offSetCon;
LedgerJournalTable ledgerJournalTable;
ledgerJournalCheckPost ledgerJournalCheckPost;
journalTable = new AxLedgerJournalTable();
journalTrans = new AxLedgerJournalTrans();
//Journal Name
journalTable.parmJournalName('GenJrn');
journalTable.save();
journalTrans.parmJournalNum(journalTable.ledgerJournalTable().JournalNum);
journalTrans.parmTransDate(mkDate(04,05,2017));
journalTrans.parmAccountType(LedgerJournalACType::Ledger);
//LedgerDimension => Ledgeraccount, DAX 2009
accCon = ["500200", "500200",2,"Department","023","Costcenter","009"];
journalTrans.parmLedgerDimension(AxdDimensionUtil::getLedgerAccountId(accCon));
journalTrans.parmAmountCurDebit(200);
//OffsetLedgerDimension => OffsetLedgerAccount, DAX 2009
journalTrans.parmOffsetAccountType(LedgerJournalACType::Ledger);
offSetCon = ["510370", "510370", 1, "Department", "022"];
journalTrans.clearField(fieldNum(LedgerJournalTrans, OffsetLedgerDimension), false);
journalTrans.parmOffsetLedgerDimension(AxdDimensionUtil::getLedgerAccountId(offSetCon));
journalTrans.save();
//ledgerJournalCheckPost = ledgerJournalCheckPost::newLedgerJournalTable(journalTable.ledgerJournalTable(),NoYes::Yes);
//ledgerJournalCheckPost.run();
info(strFmt("Journal %1 created", journalTable.ledgerJournalTable().JournalNum));
I need to set the field values from the another table that has the values
So Plz help me out.
*This post is locked for comments
Hi Martin
Thanks for the reply i am able to solve the Issue and for the suggestion You gave is quite helpful .
journalTrans.clearField(fieldNum(LedgerJournalTrans, OffsetLedgerDimension), false);
This need to be call after the Offset Dimension So it helped me solve the problem.
I am able to create Offset Dimension now.
Hi Rafe, please use the </> button in the rich formatting view to paste source code. Also, please remove unused variables and other things that don't add any value and merely make your code harder to understand. Here is the result:
AxLedgerJournalTable journalTable = new AxLedgerJournalTable(); AxLedgerJournalTrans journalTrans = new AxLedgerJournalTrans(); container accCon; container offSetCon; //Journal Name journalTable.parmJournalName('GenJrn'); journalTable.save(); journalTrans.parmJournalNum(journalTable.ledgerJournalTable().JournalNum); journalTrans.parmTransDate(mkDate(04,05,2017)); journalTrans.parmAccountType(LedgerJournalACType::Ledger); //LedgerDimension => Ledgeraccount, DAX 2009 accCon = ["500200", "500200",2,"Department","023","Costcenter","009"]; journalTrans.parmLedgerDimension(AxdDimensionUtil::getLedgerAccountId(accCon)); journalTrans.parmAmountCurDebit(200); //OffsetLedgerDimension => OffsetLedgerAccount, DAX 2009 journalTrans.parmOffsetAccountType(LedgerJournalACType::Ledger); offSetCon = ["510370", "510370", 1, "Department", "022"]; journalTrans.clearField(fieldNum(LedgerJournalTrans, OffsetLedgerDimension), false); journalTrans.parmOffsetLedgerDimension(AxdDimensionUtil::getLedgerAccountId(offSetCon)); journalTrans.save(); info(strFmt("Journal %1 created", journalTable.ledgerJournalTable().JournalNum));
Unfortunately I don't understand your requirement, therefore I can't help you. Consider elaborating what you need and what kind of problem you have with it.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156