Thursday, May 11, 2023

Extension button confirm purchase order on D365FO

[ExtensionOf(formControlStr(PurchTable, buttonConfirm))]

final class PurchTable_buttonConfirm_Extension

{

    public void clicked()

    {

        FormControl callerButton = any2Object(this) as FormControl;

        FormRun formRun = callerButton.formRun();

        FormDataSource purchTable_ds = formRun.dataSource(tablestr(PurchTable));

        PurchTable purchTable = purchTable_ds.cursor();

              

        info(strFmt('Before next PurchId %1', purchTable.PurchId ));


        next clicked();

        

        info(strFmt('After next PurchId %1', purchTable.PurchId ));

    }

}