Creating a purchase order
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 a standard method provided by the application.
How to do it...
Carry out the following steps in order to complete this recipe:
- Add a new runnable class named
CreatePurchOrder
with the following code snippet:
static void PktCreatePurchOrder(Args _args) { NumberSeq numberSeq; PurchTable purchTable; PurchLine purchLine; ttsBegin; //initialize number sequence objects numberSeq = NumberSeq::newGetNum( PurchParameters::numRefPurchId()); numberSeq.used(); purchTable.PurchId = numberSeq...