Hi everybody,
I’m new in AX, and I want to create an LedgerJournal by X++.
Whats the best form to create it?
I actually use this form:
axLedgerJournalTable = AxLedgerJournalTable::construct();
axLedgerJournalTable.parmJournalName(journalName);
axLedgerJournalTable.parmName(_description);
axLedgerJournalTable.save();
axLedgerJournalTrans = AxLedgerJournalTrans::construct();
axLedgerJournalTrans.parmJournalNum(axLedgerJournalTable.ledgerJournalTable().JournalNum);
axLedgerJournalTrans.parmTransDate(str2Date(_date,123));
axLedgerJournalTrans.parmAccountType(LedgerJournalACType::Ledger);
axLedgerJournalTrans.parmLedgerDimension(_dimensionAccount);
axLedgerJournalTrans.parmTxt(_description);
axLedgerJournalTrans.parmCurrencyCode(validateCurrency.CurrencyAX);
axLedgerJournalTrans.GMA_parmOriginAccount(_originAccount);
if (_debit != 0)
{
axLedgerJournalTrans.parmAmountCurDebit(_debit);
}
else
{
if(_credit != 0)
axLedgerJournalTrans.parmAmountCurCredit(_credit);
}
axLedgerJournalTrans.save();
I only create the ledgerJournal, but when the user wants to register the LedgerJournal throws these errrors:
"The voucher “NumberOfVoucher” has already been used on the date “TodayDate”
"The voucher “NumberOfVoucher” has already been used on the date “TodayDate” and so on.
Why this happens ?
PD: Multiple users use the app for create ledgerJournals