RE: Creating General Journals in AX7 in X++
Hi Andre,
I am using JournalTableData and JournaTransData to create new line to existing journal as below however keep getting field Id 0 does not exist on journalTransData.create() method. Can you see I am missing anything in below lines.
LedgerJournalTrans jourTrans;
LedgerJournalTableData jourTableData;
LedgerJournalStatic jourStatic;
JournalTransData jourTransData;
jourTableData = JournalTableData::newTable(_ledgerJournalTable);
//jourTableData.journalTable(_ledgerJournalTable);
jourTableData.initFromLedgerJournalTable(_ledgerJournalTable);
jourTableData.initFromJournalName(LedgerJournalName::find(_ledgerJournalTable.JournalName));
jourStatic = jourTableData.journalStatic();
jourTransData = jourStatic.newJournalTransData(jourTrans, jourTableData);
jourTransData.initFromJournalTable();
jourTrans.CurrencyCode = _ledgerJournalTrans.CurrencyCode;
jourTrans.TransDate = _ledgerJournalTrans.TransDate;
jourTrans.parmLedgerDimension(_ledgerJournalTrans.LedgerDimension);
jourTrans.Txt = _ledgerJournalTrans.Txt;
jourTrans.parmOffsetLedgerDimension(_ledgerJournalTrans.OffsetLedgerDimension);
jourTrans.AmountCurCredit = __ledgerJournalTrans.AmountCurCredit;
jourTransData.create();