Deleting purchase order

Hi All,

Can anyone give an idea to delete the PO using X++ code which has the receipt with the status received? I want to remove it fully.

Thanks in advance.

With regards,
Raman S.

Hi Raman, You should not do that, the delete button on the PO disabled for a reason. you have to cancel the receipt then finalize the PO and cancel the whole PO.

Thanks, Ahmad.