Modifying multiple forms dynamically
In the standard Dynamics AX application, there is a class called SysSetupFormRun
. Every runtime form inherits that class; therefore the class could be used to override some of the common behavior for all Dynamics AX forms.
For example, form background color could be changed depending on some parameters, some controls could be hidden or added depending on specific circumstances, and so on.
In this recipe, we will modify the SysSetupFormRun
class to automatically add an About Microsoft Dynamics AX button to every form in Dynamics AX.
How to do it...
Carry out the following steps in order to complete this recipe:
1. In the AOT, open
SysSetupFormRun
class, and create a new method with the following code:private void addAboutButton() { FormActionPaneControl actionPane; FormActionPaneTabControl actionPaneTab; FormCommandButtonControl cmdAbout; FormButtonGroupControl btngrp; #define.taskAbout(259) actionPane = this.design().controlNum(1); if (!actionPane || !(actionPane...