Can anyone explain how to access the next Journal Number via class JournalTableData's nextJournalId() method?
In X++, the call looks like this:
this.JournalNum = JournalTableData::newTable(this).nextJournalId();
Since nextJournalId is not static, I have to create a JournalTableData instance and call JournalTableData.newTable() method.
C#:
myJournalDTO.Number = JournalTableData.newTable(null).nextJournalId();
I'm not sure what to do for the required parameter to newTable of a JournalTableMap. The above gives a run time exception: {"Buffer not specified for call of JournalStatic::construct"} System.Exception {Microsoft.Dynamics.AX.ManagedInterop.ErrorException}
I tried to create a JournalTableMap next, but same exception. Looking at X++, it seem the parameter, while a JournalTableMap also accepted "this" which is a LedgerJournal Table. I am unable to Cast LedgerJournalTable proxy into JournalTableMap... So Confused...
Any help is appriciated.
Thanks,
Joe
*This post is locked for comments
I have the same question (0)