D365F&O - X++ - create modified method coc of form control in form extension

 1- Right click on form and click "create extension".

[ExtensionOf(formControlStr(CustFreeInvoice, OrderAccount))]
final class CustFreeInvoiceOrderAccount_Extension
{
    public boolean modified()
    {
        Boolean ret = next modified();
       
        FormDataSource custInvoiceTable_ds = this.formRun().dataSource(tableStr(CustInvoiceTable));
        custInvoiceTable custInvoiceTable = custInvoiceTable_ds.cursor();       

        if (CustInvoiceTable.RecId == 0)
        {
            CustInvoiceTable.write();
        }
        custInvoiceTable_ds.research(true);
        return ret;
    }
}

Comments

Popular posts from this blog

D365F&O - X++ - Set contract parameter value in controller class of SysOperationServiceBase framework

D365F&O - X++ - Create and post Customer payment Journal using X++ code.

D365F&O - X++ - Create Batch job using SysOperationServiceBase in X++