Thursday, November 24, 2022

D365FO:Cancel Purchase order through X++

 Create a new class and extend standard PurchCancel class

class PurchCancel_CUSTOM extends PurchCancel
{
    public void cancelPO(PurchTable _PurchTable)
    {
        PurchCancel_CUSTOM purchCancel = PurchCancel_CUSTOM::construct();
        purchCancel.parmPurchTable(_PurchTable);
       // purchTable = _PurchTable;
        purchCancel.run();
    }

    static PurchCancel_CUSTOM construct()
    {
        return new PurchCancel_CUSTOM();
    }

    void new()
    {
        super();
    }
}

No comments:

Post a Comment

Table browser URL in D365FO

Critical Thinking icon icon by Icons8