How to send parameters to forms in D365
To send parameters to forms
step1: first set the name of the parameter in menu item
There is a parameters property in menu item set the parameters property with some name (string only).
after that override the init method in form
copy and paste the following code
if (element.args()) // it will check are there any args from menu item where we set parameters property with some property value
{
//Parameter Args
if (element.args().parm() == 'EnableReadOnly') //parm() method specifically gets whatever string we pass in the parameters property
{
//disable data sources
Sports_ds.allowEdit(false); // this button wi
Sports_ds.allowDelete(false);
Sports_ds.allowCreate(false);
//disable buttons in button group
FormButtonGroupControl1.enabled(false); //In the button group property set the Auto Declaration Property set to Yes then only we can disable the button group
}
}
Comments
Post a Comment