Change Color of your Dynamics AX Environments/Forms
To change the color of the Dynamics forms to help indicate what environment is in use. It involved overriding the SysSetupFormRun.run() method, which will be called every time a form is opened. On the class SysSetupFormRun, create a new method with this code:
public void run()
{
SysSQLSystemInfo systemInfo = SysSQLSystemInfo::construct();
;
super();
// Set the color scheme of this instance of the SysFormRun to RGB
this.design().colorScheme(FormColorScheme::RGB);
// If the database name is not the live version, change the color of the form
if (systemInfo.getloginDatabase() != 'DynamicsAX_test')
this.design().backgroundColor(0x112255);
}
If your live and test systems use the same database name, but the AOS is running on different servers you can modify this code to to match on systemInfo.getLoginServer() != 'MyServerName'. You can change the color by setting the hex value. It uses the RGB values in reverse order: 0xBBGGRR.
public void run()
{
SysSQLSystemInfo systemInfo = SysSQLSystemInfo::construct();
;
super();
// Set the color scheme of this instance of the SysFormRun to RGB
this.design().colorScheme(FormColorScheme::RGB);
// If the database name is not the live version, change the color of the form
if (systemInfo.getloginDatabase() != 'DynamicsAX_test')
this.design().backgroundColor(0x112255);
}
If your live and test systems use the same database name, but the AOS is running on different servers you can modify this code to to match on systemInfo.getLoginServer() != 'MyServerName'. You can change the color by setting the hex value. It uses the RGB values in reverse order: 0xBBGGRR.
thanks,
Vikas Mehta
No comments:
Post a Comment