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

Creating purchase orders

Creating purchase orders from code is one of the many things that are required when building custom functionality. Normally, the user selects only a few bits of information like vendor account, item number, delivery date, etc. and the rest is created by the system. It is also possible that purchase orders may be created as part of some process in custom modules.

In this recipe, we will learn how to create a purchase order from X++ code. We will use a standard method provided by the application.

How to do it...

  1. In AOT, create a new class called PurchaseOrderCreate with the following code:
    class PurchaseOrderCreate
    
    {
    }
    public static void main(Args _args)
     { NumberSeq numberSeq; PurchTable purchTable; PurchLine purchLine; ; ...

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