Posting Invoice from Sales order/ Purchase order.

One of the most commonly used classes in AX are the FormLetter classes. The
FormLetter classes define how to post different status updates against sales orders
and purchase orders.
The normal flow when a posting is being performed is that the parm tables are
Populated with data, and then the update itself is performed.
Below example will shows how to Post the Invoice from sales order, similar logics can be used to post the Invoice from Purchase order.

static void postSalesInvoice(Args _args)
// Define a classvariable according to the
// type of posting being performed
SalesFormLetter_Invoice invoice;
SalesTable salesTable;
// Select the salesTable to update
salesTable = SalesTable::find(“SO-101297”);
// Create a new object of the SalesFormLetter_Invoice
// by using the construct-method in SalesFormLetter
invoice = SalesFormLetter::construct(DocumentStatus::Invoice);
// Post the invoice
true); // Set to true to print the invoice

The next screenshot shows the class hierarchy of FormLetter with all its subclasses: we can easily custamize the above logic to post different status updates against sales orders
and purchase orders

Sales (Confirmation, Picking list, Packing slip, Invoice )
Purch (Purchase order,Receipt list, Packing slip, Invoice)



6 Responses to Posting Invoice from Sales order/ Purchase order.

  1. clouppe says:

    Hi and thank you for your interesting articles.

    I’m a novice in AX 2009 and i’ve just passed the MB6-819 certification exam.
    I’ve got a few questions about posting invoices (AR/sales and AP/purchase).

    I’d like to enable the user to record invoices in AX (and get an invoice number) but WITHOUT posting the invoice. The posting would be done in another step.

    Do you think it’s possible?
    I don’t know where and when the invoice document is generated.

    Thanks for your help!

    • Amir Nazim says:

      well your scenario is bit different, and i think it is not available in AX. but it can be custamized by create a simple form for creating the invoice. if you would like to know wbout the invoice posting process in dynamics ax then see below link. it will helps you.

      How to Record/Create/Post invoice.
      Open the Purchase order form (Accounts payable > Common Forms > Purchase Order Details).
      Click Posting > Invoice. The Posting invoice form opens.
      see link for more details

  2. Sajid says:

    Nazim bhai,

    any experience in creating Sales ordering using File adapter and XSD XML?

  3. Pingback: Some important sales order / purchase order opeations AX 2009 « Amir's Microsoft Dynamics AX space

  4. Pingback: Amir's Microsoft Dynamics Ax Space

  5. Pingback: Amir's Microsoft Dynamics Ax Space

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: