Purchase orders are used throughout the purchasing process to hold information about the goods or services that a company buys from its suppliers. Normally, purchase orders are created from the user interface, but in automated processes, purchase orders can be also created from the code.
In this recipe, you will learn how to create a purchase order from the code. We will use one of the standard methods provided by the application.
Carry out the following steps in order to complete this recipe:
In the AOT, create a new job named
PurchOrderCreate
with the following code snippet: (replace the values in the code to match your data)static void PurchOrderCreate(Args _args) { NumberSeq numberSeq; PurchTable purchTable; PurchLine purchLine; ttsBegin; numberSeq = NumberSeq::newGetNum( PurchParameters::numRefPurchId()); numberSeq.used(); purchTable.PurchId = numberSeq.num(); purchTable.initValue(); purchTable.initFromVendTable...