Published On: February 2, 2017Categories: Technical

Adding description to a transaction happens to be a common problem in Microsoft Dynamics AX 2012. In this blog post we are going to give you a short insight about describing the steps of adding custom description to allocation ledger transaction.

Adding custom description to allocation ledger transaction

First you need to extend the LedgerAllocationItem class with the parm method for description. This class holds the information related to an account allocation.

adding custom description to allocation ledger transaction
The LedgerAllocationController class allocates an allocation account to the physical ledger accounts that it represents. The LedgerAllocationController class has a method that performs the actual allocation of the amount based on percentage and creates the ledger – allocateAmounts method. In this method you have an instance of LedgerAllocationItem class and you can fill data for description calling parm method that you have created.

description to allocation ledger transaction parm method
Then in LedgerVoucherTransObject class (represents a single transaction in an individual voucher) in newLedgerAllocationItem method (initializes a new instance of the LedgerVoucherTransObject class from a ledger allocation item) you can fill transaction by calling the parmTransTxT with the description that you put on ledgerAllocationItem instance.

custom description to allocation ledger transaction parmtranstct
This should happen no matter where the transaction is posted from. It could be a general journal, a free text invoice, an invoice journal, etc.