D365F&O - X++ - Get datasource in modified method COC in form control extension

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

        if (CustInvoiceTable.RecId == 0)
        {
            ret = true;
        }
        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++