Cancel a PO in ax2012

Hi Gurus,

Please help.

If anyone found the code to cancel a purchase order which is confirmed.

When you hit ‘cancel’ button on the PO list page in ax2012, the approval status changes from confirmed to ‘Approved’ and status to ‘cancelled’.

I am trying to do this from x++ code by giving the purchId.

Thanks in advance.


found it.