Thursday, 22 August 2013

Pass Customized Fields to GeneralJournalAccountEntry Table

In this tutorial I am going to show you how to pass a customized field to the GeneralJournalAccountEntry Table, when a ledger to ledger voucher is posted

Scenario - For example lets say you have a new vertical with industry relevant fields and you want to see your financial reports or TB based on this field. In order to  fullfill this requirement we will have to pass this field throughout AX 2012, mainly the General Journal Account Entry Table.

Step 1. Create this field in the LedgerJournalTrans Table and GeneralJournalAccountEntryTable.

Step 2. Declare this field in the class declaration of the LedgerVoucherObjectClass

Step 3. Create a parm method in the LedgerVoucherObject Class.

 public ARNID parmARNID(ARNID _ARNID = ARNID)  
 {  
    ARNID = _ARNID;  
    return ARNID;  
 }  

Step 5 Create a parm method in the LedgerVoucherTransObject Class

 public ARNID parmARNID(ARNID _ARNID = ARNID)  
 {  
    generalJournalAccountEntry.ARNID = _ARNID;  
    return generalJournalAccountEntry.ARNID;  
 }  

Step 6 Add the following line of code to the getLedgerPostingTransaction method of the LedgerVoucherTransObject Class

 _LedgerPostingTransaction.ARNID = GeneralJournalAccountEntry.ARNID  

Step 7 Add the following line of code to the initFromLedgerPostingTransactoin method of the LedgerVoucherTransObject Class

 GeneralJournalAccountEntry.ARNID = _LedgerPostingTransaction.ARNID;  


Step 8 Add the following line of code to the newTransLedgerJournal method of the LedgerVoucherTransObject Class

 ledgerTransObject.parmARNID(_ledgerJournalTrans.ARNID);

In the coming days I will write similar posts for how we can do the same for


  1. BankTrans
  2. CustTrans
  3. VendTrans

3 comments:

  1. please any solution for this problem ?!

    I want to change the description of the accounting entry

    (GeneralJournalAccountEntry) by the description provided on the purchase order (supplier order).


    ReplyDelete
    Replies
    1. Did you find a way to do that? Could you share it please?

      Delete
  2. Step 4 is missing. Please write.

    ReplyDelete