How does the LedgerTrans table get populated?

I’m reading that I should work with the classes LedgerVoucher, LedgerVoucherObject and LedgerVoucherTransObject but I need more detail…how does it get populated? For instance, if I created a new field in the LedgerTrans table to store the journal number, how do I post from an inventory journal or from a GL journal?

This is what I’ve done: I declared my field and create the parmJournalID() methods. I place my breakpoint in LedgerVoucher.addTrans() and the LedgerVoucherObject .addTrans() but the journalID seems to have already been passed when the parmJournalID() method is called. Please help!

To see how ledger journals are posted, look at LedgerJournalCheckPost.postJournal().