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

Popular posts from this blog

How to Create a wizard in x++ d365

how to post trade agreement journals automatically using x++ code

X++ code to CREATE AND POST A TRADE AGREEMENT IN MICROSOFT DYNAMICS 365 in D365 F & O