Dynamics 365 for Finance and Operations Development Cookbook - Fourth Edition
by Abhimanyu Singh, Deepak Agarwal
How it works...
In this recipe, we created a new job named CreatePurchOrder, which holds all the code. Here, we start by getting the next purchase order number with the help of the NumberSeq class. We also call the initValue() and initFromVendTable() methods to initialize various purchTable buffer fields. Normally, the argument of the initFromVendTable() method should come from a user selection screen or some other source, but for demonstration purposes, we specify the value in the code. We insert the purchase order record into the table only if the validation in the validateWrite() method is successful.
Next, we create purchase order lines. Here, we assign the previously used purchase order number and then set the item number. As previously ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access