COC for Form level method


We can extend the logic of public and protected methods without having to use event handlers. COC, allows to use the method local and global variables. COC must be end with _Extension.

Form level method :
System search there are any extend methods , If Extend method is exist,run COC method first , next() method Invoke Standard form methods.

Override Method:

[ExtensionOf(formstr(CustTable))]

    final class CustTableForm_Extension
    {
        public void init()
        {
            // here add the business logics
            next init();
            // here add the business logics

        }
    }


Get buffers :

FormRun formRun = this as  FormRun;

    FormDataSource CustTable_DS =formRun.datasource(ForomDatasourceStr(CustTable,CustTable));

    CustTable custTable = CustTable_DS.Cursor();

    FormControl custAccount = formRun.design().ControlName(FormControlStr(FormName,ControlName));

    
 Example:

    [ExtensionOf(formstr(CustTable))]
    final class CustTableForm_Extension
    {
        public void init()
        {
            FormRun formRun = this as  FormRun;
            FormDataSource CustTable_DS =formRun.datasource(ForomDatasourceStr(CustTable,CustTable));
            CustTable custTable = CustTable_DS.Cursor();

            FormControl custAccount = formRun.design().ControlName(FormControlStr(FormName,ControlName));

            next init();
            custtable.CustGroup = “40”;
            custAccount.visible(custtable.CustGroup);


        }
    }


Comments

Popular posts from this blog

SSRS Report using Controller , Contract and RDP classes in D365

Exporting data to Excel through X++ code

How to pass the parameter from one form to another in Dynamic365

Multi Select Lookup in SSRS Report in D365