With following code we can create general journal with default dimention and ledger Account
just change default values according to youe system data and simply run the job
static void Demo_CreateGLJrl(Args _args)
{
AxLedgerJournalTable axLedgerJournalTable ;
AxLedgerJournalTrans axLedgerJournalTrans;
container accPattern;
container offSetPattern;
container dimPattern1;
;
axLedgerJournalTable = new AxLedgerJournalTable();
axLedgerJournalTrans = new AxLedgerJournalTrans();
dimPattern1 = [1,"Department", "000"];
axLedgerJournalTable.parmDefaultDimension(AxdDimensionUtil::getDimensionAttributeValueSetId(dimPattern1));
axLedgerJournalTable.parmJournalName("GenJrn");
axLedgerJournalTable.save();
axLedgerJournalTrans.parmJournalNum(axLedgerJournalTable.ledgerJournalTable().JournalNum);
axLedgerJournalTrans.parmTransDate(systemDateGet());
axLedgerJournalTrans.parmAccountType(LedgerJournalACType::Ledger);
accPattern = ["420100", "420100", 0];
axLedgerJournalTrans.parmLedgerDimension(AxdDimensionUtil::getLedgerAccountId(accPattern));
offSetPattern = ["420200", "420200", 0];
axLedgerJournalTrans.parmOffsetAccountType(LedgerJournalACType:: Ledger );
axLedgerJournalTrans.parmOffsetLedgerDimension(AxdDimensionUtil::getLedgerAccountId( offSetPattern));
axLedgerJournalTrans.save();
info(strFmt("Journal %1 created with finential Dimension %2", axLedgerJournalTable.ledgerJournalTable().JournalNum,axLedgerJournalTable.ledgerJournalTable().DefaultDimension));
}
thanks good response
ReplyDeletehi
ReplyDeletehow create more lines in the same journal
This example is for one line. how to for several lines
ReplyDeleteNice post thank you Darnell
ReplyDelete