Hi all,
Trying to create & post general journal through x++ code.
I've successfully created & posted. But I found data inconsistency in the table
"GeneralJournalEntry". field "JournalCategory" not have any value, which is mandatory in the table.
This is happening only when journal created, posted through x++ code.
Please find the script, & screen shots.
//Header
journalTable = new AxLedgerJournalTable();
journalTable.parmJournalName("ME");
journalTable.save();
select firstOnly ledgerJournalTrans_source //testing purpose selected posted transaction
where ledgerJournalTrans_source.RecId == 5637147721;
// createJournalLine(true);
journalTrans = new AxLedgerJournalTrans();
journalTrans.parmJournalNum(journalTable.ledgerJournalTable().JournalNum);
journalTrans.parmTransDate(systemDateGet());
journalTrans.parmCurrencyCode(companyCurrency);
journalTrans.parmVoucher("ME-8111");
journalTrans.parmAmountCurDebit(422);
journalTrans.parmAccountType(ledgerJournalACType::Ledger);
journalTrans.parmLedgerDimension(ledgerJournalTrans_source.OffsetLedgerDimension);
journalTrans.save();
journalTrans = new AxLedgerJournalTrans();
journalTrans.parmJournalNum(journalTable.ledgerJournalTable().JournalNum);
journalTrans.parmTransDate(systemDateGet());
journalTrans.parmCurrencyCode(companyCurrency);
journalTrans.parmVoucher("ME-8111");
journalTrans.parmAmountCurCredit(422);
journalTrans.parmAccountType(ledgerJournalACType::Cust);
journalTrans.parmLedgerDimension(ledgerJournalTrans_source.LedgerDimension);
journalTrans.save();
ledgerJournalCheckPost = ledgerJournalCheckPost::newLedgerJournalTable(journalTable.ledgerJournalTable(), NoYes::Yes);
ledgerJournalCheckPost.run();
Kindly suggest, changes required in the script?
*This post is locked for comments