In Dynamics 365 for Finance and Operations, the purchase order goes through a number of statuses in order to reflect its current position within the purchasing process. The status can be updated either manually by using the user interface or programmatically from the code as well.
In this recipe, we will demonstrate how a purchase order status can be updated from the code. We will confirm the purchase order created in the previous recipe and print the relevant document on the screen.
Carry out the following steps in order to complete this recipe:
- Add a new runnable class, named
ConfirmPurchOrder
with the following code snippet. Replace00000044
with your number, that is created after previous codeCreatePurchOrder
(your PO number could be different from mine so double-check):
static void ConfirmPurchOrder (Args _args) { PurchFormLetter purchFormLetter; PurchTable purchTable; purchTable = PurchTable...