O'Reilly logo

Microsoft Dynamics AX 2009 Development Cookbook by Mindaugas Pocius

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Posting sales orders

Sales order posting is also done in a very similar way to posting a purchase order. The posting function can be executed from code and can be integrated into various customizations.

In this recipe, we will use a standard Dynamics AX API to post and print a sales packing slip document from code. As an example, we will post and print a packing slip for the sales order created in the previous recipe.

How to do it...

  1. In AOT, create a new class called SalesOrderPost with the following code (replace SO-100160 with your number):
    class SalesOrderPost
    
    {
    }
    public static void main(Args _args)
     { SalesFormLetter salesFormLetter; salesTable salesTable; ; salesTable = SalesTable::find('SO-100160'); salesFormLetter = SalesFormLetter::construct( ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required