Monday, December 12, 2011

Color code forms in AX 2012, depending on environment/company

One thing that you might miss in the AX client is as a higher visibility of which company and environment that you’re working in. I have seen plenty of solutions where the entire background of forms is colored according to the current company, making each form look like something the cat has coughed up.

The least intrusive solution and the only one I have taken time to modify a bit and implemented at a customer is the one made by Arijit Basu. I have modified it, allowing you to choose your own color and a customer text per AOS. Since not all forms are designed entirely correct, the solution unfortunately doesn’t work as expected on all forms.

In AX 2012 the game has changed, because there is no background left on the forms to color. But the good folks at Microsoft has anticipated that we want to do some coloring still, and there’s a new method on FormRun which allows you to color the background of the statusbar; setStatusBarBackgroundColor.

I have made a solution using this method. The solution allows you to select a color per database server, database and company. If you don’t specify a company, the color works for all companies on the selected server and database.

I have included database server and name to support the scenario where you copy your production database to a test database. This way you can setup the indication for working in the test environment from your production system and you don’t need to add any information after having copied production data to test.

The solution is absolutely version 1, but I expect to add more features for the visualization in the time to come. One thing I’d like to add as soon as possible is some kind of identification in the infolog.
I have one known issue with the solution, which is that the lookups on database server and database don’t quite show all the servers and databases that I expected. I’ll look into that at some point, but any hints are welcome.

Example of form:

You can download the solution as an XPO or a model file from my SkyDrive.