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
}
}
No comments:
Post a Comment