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 purchase orders

Purchase order posting is the next logical step after creating a purchase order. Normally, in the application, users use the Posting button on the Purchase Order Details form to post purchase orders. This function can also be executed from code and can be integrated into various customizations.

In this recipe, we will use a standard Dynamics AX API to post a purchase order and print the relevant document from code. As an example we will post and print the previously created purchase order.

How to do it...

  1. In AOT, create a new class called PurchaseOrderPost with the following code (replace 000097 with your number):
    class PurchaseOrderPost
    
    {
    }
    public static void main(Args _args)
     { PurchFormLetter purchFormLetter; PurchTable ...

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