Post Details

How can I view the tool bar in D365FO using X++?

You can view the tool bar in D365FO using X++ code by accessing the form's control and retrieving the tool bar control. Here is an example code snippet to view the tool bar in D365FO using X++:


                            
FormRun formRun;
FormDataSource formDataSource;
FormBuildControl formBuildControl;

// Open the form
formRun = ClassFactory.formRunClass('YourFormName').construct();
formRun.init();
formDataSource = formRun.dataSource('YourDataSourceName');

// Retrieve the tool bar control
formBuildControl = formRun.design().controlMethodOverloadObject('Toolbar');
formBuildControl.visible(true);

// Show the form with the tool bar
formRun.run();

                        

` In the above code, replace 'YourFormName' with the name of the form you want to view, and 'YourDataSourceName' with the name of the data source used in the form. This code snippet will open the specified form, access its tool bar control, and set it to be visible before displaying the form with the tool bar.


Leave A Reply


Name*

E-mail*