Color-code your Dynamics environments in Ax 2012

Color-code your Dynamics environments

Since implementing Axapta / Dynamics AX in 2003, we’ve found it invaluable to provide an environment for testing and training as well as our live system (or production environment) to end users. This lets people try different processes or train new employees without fear of screwing up the “real” data.

Occasionally, though, we’ve run into a problem where someone thought they were using the live system, but were actually in the test environment. It’s an easy mistake to make. There is no obvious visual cue to alert a user that they are working on a test system.

There is a way 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() != ‘MyDBName’)
this.design().backgroundColor(0x112255);
}

That’s all there is to it. 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.

Variations of this code could switch form colors to indicate the current user account, application layer, or company. Less practical uses could match color to the time of day or season of the year. If you find this code useful, leave me a message noting what you did with it.

=========================

For more information on changing form colors and sample code for version 3.0, see:

http://dynamics-ax.blogspot.com/2006/04/changing-form-color-based-on-current.html

=======================

Sample screens showing how the code above changes the test environment forms compared to the same form in the live production environment.

 

Ref : http://discoverax.blogspot.in/2007/12/color-code-your-dynamics-environments.html

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s