I have a requirement to cancel the PO, from a customization screenbased on the business logic. We have tried implementing the below code but no luck.
POOrderEntry docgraph = PXGraph.CreateInstance<POOrderEntry>();
docgraph.Document.Current = ItemList; // Item List is current PO
docgraph.Document.Update(docgraph.Document.Current);
docgraph.Cancel.Press();
Can some one help me on this?