Good morning,
As i have requirement to cancel PO line through code.
i have found in internet this piece of code.
void cancelPurchLine(recId PurchLineRecId)
{
    PurchLine       localPurchLine = PurchLine::findRecId(PurchLineRecId,true);
    ;
    ttsbegin;
 
    localPurchLine.RemainPurchPhysical = 0;
    localPurchLine.RemainInventPhysical = 0;
 
    localPurchLine.update();
 
    ttscommit;
}
is this the correct way.
Please show some light on this.
Regards,
Have a nice day.