Form colors in Dynamics AX 2012

A client wanted form color to reflect the environment (AOS) they were in. It’s changed a bit in 2012. I found a post online but had to tweak it to work for me. Here is the code.

Sorry for the layout; still getting the hang of this blogging thing.

Class SysSetupFormRun method init

public void init()
SysSQLSystemInfo systemInfo = SysSQLSystemInfo::construct(); // mca jeb 05Nov2012
str databaseName; // mca jeb 05Nov2012


if (this.isWorkflowEnabled())
workflowControls = SysWorkflowFormControls::construct(this);

// mca jeb 05Nov2012 begin;
databaseName = systemInfo.getloginDatabase();
switch (databaseName)
case “DAX2012_DEV”:, 176, 255));//mauve
case “DAX2012_CRP”:,255,153));//canary
case “DAX2012_TEST”:,251,152));//pale green
case “DAX2012_PREPROD”:,99,71));//tomato
info(strFmt(“Database %1 does not have a color”, databaseName));
// mca jeb 05Nov2012 end

About janeteblake

Dynamics AX developer
This entry was posted in AX2012, Dynamics AX. Bookmark the permalink.

Leave a Reply

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

You are commenting using your 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