Creating records in CustTrans during the Invoicing process for a Sale Order

Hello Everyone,

Can comeone tell me when exactly Ax creates a record in the CustTrans table after posting an invoice for a sale Order

When I create a saleOrder and invoice it, I go to Cutomer transactions, I find a record with the amount that has been invoiced and other information, I need to know which method is called to create that record in CustTrans

I know that SalesFormLetter_Invoice Class is called during the process, but I don’t know where I can find the piece of code that inserts into CustTrans.

Thank you for your help.

In AX 2009

\Classes\SalesFormLetter_Invoice\createCustTrans will start the process and

\Classes\CustVendVoucher\post will do the insert

In AX 2012

\Classes\SalesInvoiceJournalPost\postCustVend will start the process and

\Classes\CustVendVoucher\post will do the insert

They use custVendTrans Map.

The easiest way to find these things is to add a break point to the custTrans.insert() method and to follow the call stack…

Thanks Kranthi! It helped me.