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++ - Best Practice Warning BP Rule: [BPErrorUnknownLabel]: Path:

D365F&O - X++ - How to Enable/Disable button on form based on a condition in D365F&O using Event handlers.

D365FO - X++ - Generate CAR (Customized Analysis Report) report of custom model