Hi there, I am relitively new to X++ coding, could someone please help me, we are trying to run a job in AX 3.0 to change the current a_LedgerJournalTrans.TransDate from ‘20/11/2007’ to ‘30/11/2007’ for the journal JB000005. The code (which needs troubleshooting) is given below: static void LedgerJournalTransDateUpdate(Args _args) { //modified by NM LedgerJournalTrans a_LedgerJournalTrans; ; TTSBEGIN; while select forupdate a_LedgerJournalTrans where a_LedgerJournalTrans.JournalNum == ‘JB000005’ && a_LedgerJournalTrans.TransDate == ‘20/11/2007’ { a_LedgerJournalTrans.TransDate = ‘30/11/2007’; if (a_LedgerJournalTrans.validateWrite()) { a_LedgerJournalTrans.update(); } } TTSCOMMIT; } Please could someone help me in troubleshooting the above, I need to update the jounral transcation date asap for jounrnal JB000005. Thanks in advance Nik M
Hi Nik,
See whether this works -
while select forUpdate LedgerJournalTrans
where LedgerJournalTrans.JournalNum ==
{
LedgerJournalTrans.TransDate = str2date(“03/01/2008”,123);
if (LedgerJournalTrans.validateWrite())
LedgerJournalTrans.update();
}