Search code examples
axaptamicrosoft-dynamicsdynamics-ax-2012dynamics-ax-2012-r2

Microsoft Dynamics AX - Sales Order to Invoice class location


I'm looking to make a modification in the logic where an invoice is made from a Sales Order.

In other words, as soon as the Sales Order status changes to "Invoiced", I want to be able to add some additional code there that updates something else.

I'm having a lot of trouble finding the class where this is performed. Can somebody point me in the right direction? It would be greatly appreciated.

Thanks.


Solution

  • The classes you are looking for are

    • \Classes\SalesFormLetter_Invoice - For interacting with SalesEditLines
    • \Classes\SalesInvoiceJournalCreate - Creating journal data
    • \Classes\SalesInvoiceJournalPost - Posting a journal
    • \Classes\SalesInvoiceJournalPrint - Printing
    • \Classes\SalesFormletterParmDataInvoice - Creating parm data

    The specific method you probably want is \Classes\SalesInvoiceJournalPost\postJournalPost, which is executed after the journal has posted from \Classes\FormletterService\run#91

    Refer to this whitepaper for some more information: http://technet.microsoft.com/en-us/library/hh272871.aspx