Skip to content
Microsoft Dynamics 365

Due to popular demand, below is example code that creates a general journal in 2012 using X++ code:

   
AxLedgerJournalTable header = new AxLedgerJournalTable();

AxLedgerJournalTrans trans = new AxLedgerJournalTrans();

container  ledgerDimensions, offsetDimensions;

   
header.parmJournalName(“GenJrn”);   
header.save();  

   
trans.parmAccountType(LedgerJournalACType::Ledger);   
trans.parmJournalNum(header.ledgerJournalTable().JournalNum);   
ledgerDimensions = [“131100-USA”,”131100″, 1, “COUNTRY”,”USA”];   
trans.parmLedgerDimension(AxdDimensionUtil::getLedgerAccountId(ledgerDimensions));   
trans.parmAmountCurDebit(230);   
offsetDimensions = [“0103-USA”,”0103″, 1, “COUNTRY”, “USA”];   
trans.parmOffsetLedgerDimension(AxdDimensionUtil::getLedgerAccountId(offsetDimensions));   
trans.save();

We're always looking for feedback and would like to hear from you. Please head to the Dynamics 365 Community to start a discussion, ask questions, and tell us what you think!