ACTIVE METHOD IN D365 ENVENT HANDLER CODE
MAKE SURE THAT YOU USE THE METHOD SIGNATURE PROPERLY.
EXAMPLE
class CustTableFormEventHandler
{
[FormDataSourceEventHandler(formDataSourceStr(CustTable, CustTable), FormDataSourceEventType::Activated)]
public static void CustTable_OnActivated(FormDataSource sender, FormDataSourceEventArgs e)
{
CustTable custTable = sender.cursor(); //selected record
FormDataSource custTable_ds = sender.formRun().dataSource("CustTable"); //DataSource
FormRun element = sender.formRun(); //form element
FormControl myNewButton = element.design(0).controlName("MyNewButton");
//button on the form
myNewButton.enabled(false); // enabled or disabled the button
}
}
Thanks,
Vikas Mehta
Vikas Mehta
No comments:
Post a Comment