Search This Blog

Saturday, September 3, 2022

Called another form using x++ Dynamics 365 F&O

There are many ways to call the form in Dynamics 365 Finance and Operation. if need to run the form and form should show the detail of the specified record then in that case we can use the below code to call the form. 

In the below code, I am calling the sales order form and it will show the the SalesId specfieid. 


        SalesTable      salesTable = SalesTable::find("SalesId");

        Args            args = new Args(formStr(salestableDetails)); //Specify the form name here

        FormRun         formRun;

   

        //Specify the record

        args.lookupRecord(salesTable);

       

        formRun = classFactory.formRunClass(args);

        formRun.init();

        formRun.run();

        FormRun.detach(); //you can call the wait method overhere as well. it is completed based on the requirement