Thursday, April 16, 2020

How to disable Standard delete button in D365 Form

Disabled delete button in D365

FormCommandButtonControl delButton;

    public void init()
    {
        #SysSystemDefinedButtons

        super();
delButton = this.control(this.controlId(#SystemDefinedDeleteButton)) as FormCommandButtonControl;
        delButton;.visible(false);
    }

Wednesday, April 1, 2020

COC Methods for Extending form control enable or visible in D365

Form Control Methods in D365


[ExtensionOf(formstr(CustFreeInvoice))]
public final class CustFreeInvoice_Form_Extension
{
    void init()
    {
        FormRun formRun = this;
        FormCheckBoxControl ReleaseOrderOnCreditLimit = formRun.design().controlName(formControlStr(CustFreeInvoice,ReleaseOrderOnCreditLimit));

        FormDataSource CustInvoiceTable_DS = formRun.dataSource(formDataSourceStr(CustFreeInvoice,CustInvoiceTable));
         
        next init();

   /*
Other way to get control name
                                                                formRun.design().controlName('TaxVATNum'),
                                                                formRun.design().controlName('VATNum'),
                                                                formRun.design().controlName('NumCheckCtrl'),
                                                                formRun.design().controlName('ViesCheckCtrl'),

*/

        ReleaseOrderOnCreditLimit.visible(false);

}

}