Monday, January 4, 2021

D365 F&O call ACTIVE Method through extension

As we can't modify any standard method in D365 F&O , so we need to pass all of it's component in Code Of Command (COC). Below is the syntex for  "Active" Methos in vend Table form where we are enabling a field based on #Checkbox selection. Hope it'll help ... At least me in Future 😆 



[ExtensionOf(formdatasourcestr(VendTable, VendTable))] // Extension of Standard Obejct

final class VendTable_Extension

{

  

    public int Active()

    {

        int             ret;

        VendTable       vendTable           =  element.Vendtable; // Direct Table buffet for value 

        FormDataSource  vendTable_ds        = element.vendtable_ds; // Data Source Buffer


        ret = next Active(); // Calling standard Active Logic


    // adding Addition logic to check 

        vendTable_ds.object(fieldNum(VendTable, #FieldName)).enabled(VendTable.#CheckBox == NoYes::Yes);


        return ret;

        vendTable_ds.research(true); // This is useful to stop record refresh in Active 


    }


}

Conversion of Disposition code, code was not specified - Error in D365 F&O for inter company purchase order return

 We crated the return order for inter company purchase order  and created a Item Arrival Journal through Arrival Overview in corresponding c...