static void VendPaymJournalCreate(Args _args)
{
AxLedgerJournalTable journalTable; // class
AxLedgerJournalTrans journalTrans,journalTrans1; // class
container acctPattern;
container offSetAcctPattern;
LedgerJournalTable ledgerJournalTable; // table
ledgerJournalCheckPost ledgerJournalCheckPost;// table
;
journalTable = new AxLedgerJournalTable();
journalTrans = new AxLedgerJournalTrans();
//Journal Name
journalTable.parmJournalName(“VendPay”);
journalTable.parmJournalType(LedgerJournalType::Payment);
journalTable.save();
journalTrans.parmJournalNum(journalTable.ledgerJournalTable().JournalNum);
journalTrans.parmTransDate(systemDateGet());
journalTrans.parmCurrencyCode(“USD”);
journalTrans.parmAmountCurDebit(1200);
journalTrans.parmAccountType(LedgerJournalACType::Vend);
journalTrans.parmLedgerDimension(DimensionStorage::getDynamicAccount(‘1001’,LedgerJournalACType::Vend));

journalTrans.save();

journalTrans1 = new AxLedgerJournalTrans();
journalTrans1.parmJournalNum(journalTable.ledgerJournalTable().JournalNum);
journalTrans1.parmAccountType(LedgerJournalACType::Ledger);
journalTrans1.parmLedgerDimension(22565454369);
journalTrans1.parmCurrencyCode(“USD”);
journalTrans1.parmAmountCurCredit(1200);
journalTrans1.save();

ledgerJournalCheckPost = ledgerJournalCheckPost::newLedgerJournalTable(journalTable.ledgerJournalTable(),NoYes::Yes);
ledgerJournalCheckPost.run();
info(strFmt(“Journal No. %1.”, journalTable.ledgerJournalTable().JournalNum));
}