AX2012 - Pass a value from ledgerTrans to GeneralJournalAccountEntry

I’m trying to pass a value that i may either put in a new field on LedgerJournalTrans or put in a new table related to LedgerJournalTrans by recId, so the most logic way to do it without messing around with the GeneralJournalAccountEntry table is to create a new table referencing the GeneralJournalAccountEntry recid and storing my new value in this new table.

However as you may know there is no direct relation from LedgerJournalTrans to GeneralJournalAccountEntry, of course you might “guess” what record in the GeneralJournalAccountEntry to use by playing with the account, postingtype, voucher and amount, but that goes to the trash when you have multiple accounts with the same amount in the same voucher.

Looking at the LedgerVoucherObject and LedgerVoucherTransObject i see that it might be something like what AX does with the reasonrefRecId and how it transfers it from the ledgerjournalTrans to GeneralJournalAccountEntry.

Now, this can be solved by adding a parm method and filling it in the newTransLedgerJournal method, but after doing some debugging i see some problems here.

  • parm Values in LedgerVoucherTransObject class are passed to LedgerVoucherObject class
  • then LedgerVoucherObject passes this values to LedgerVoucher
  • and finally the get passed to LedgerPostingGeneralJournalController where a temp GeneralJournalAccountEntry gets inserted to finally insert into the actual GeneralJournalAccountEntry table.

I’m lost here, i don’t know if i’m looking at this the wrong way (very possible) and there is an easier way to acomplish this.


1 Like