How to confirm the purchase order?

Hi All,

After confirmed the purchase order, i am changing the batch number of the purch order line items in product receipt form “Packing slip” by using customized button. So, the purchase order status is changed to approved. So, I have to also change the purchase order to confirm.

Please guide to confirm the purchase order through x++ code.



PurchFormLetter::construct(DocumentStatus::PurchaseOrder).update(purchTable, ‘’);