How to set the color in ax 2009 environment

hi guys…

How to set the color in ax 2009 environment using x++

What do you mean by that? In AX forms?

Thanks for reply kranti…

with background color i want to differentiate test environment and live environment in 2009

This may help you,
daxguy.blogspot.in/…/ax-environment-information-on-ui-simple.html

hi kranthi,

when i export the syssetupformrun class below error displaying please help me

While exporting the form?

No kranthi… it is a class

Use class SysSetupFormRun and method run

this.design().backgroundColor(0xAFFEC1);//Green-BBGGRR

fro example :

public void run()
{
SysSQLSystemInfo systemInfo = SysSQLSystemInfo::construct();
;
super();

if(this.design())
{
// Set the color scheme of this instance of the SysFormRun to RGB
this.design().colorScheme(FormColorScheme::RGB);
switch (systemInfo.getloginDatabase())
{
case ‘ServerName’: this.design().backgroundColor(0xAFFEC1);//Green-BBGGRR
break;
default : this.design().colorScheme(FormColorScheme::Auto);
}
}
}

Thanks

Can you show the full stack trace error?

hi kranthi,

When i put the debugging on RUN() method and open the Customer Details then system showing like in below screen shot.

Color22.PNG

Do you have any while you compile the form?

Error was like this kranthi.

Error executing code: SysSetupFormRun (object) has no valid runable code in method ‘run’.

Compile the method. Either it will fix the problem or - more likely - it will show that you have a compilation error there. If you don’t know how to fix it, show us your code, where the error is and what the compiler is saying about it.

I used the same code in \Classes\SysSetupFormRun\run and i don’t see any error.
this.design().colorScheme(formColorScheme::RGB);
this.design().backgroundColor(WinApi::rgb2int(255, 0, 0));
What else changes you have done to that class?

yes kranthi i did not do any extra changes in that, below lines only i have added,
this.design().colorScheme(formColorScheme::RGB);
this.design().backgroundColor(WinApi::rgb2int(255, 0, 0));

am not getting error while compile the code,but here is an application issue if i do any changes in class level,to reflect that changes i need to get xpo of that and i need to import again then only the changes will reflect.so while am exporting the Classes\SysSetupFormRun\run am getting that error.

Thanks for reply martin…

\Classes\SysSetupFormRun\run() method
public void run()
{
super();
this.design().colorScheme(formColorScheme::RGB);
this.design().backgroundColor(WinApi::rgb2int(255, 0, 0));
}

It could be that, you don’t have the X++ developer license. So you are unable to make the changes to the classes.
SysExportDialog used to export objects is also a form, that un saved changes might be causing that error.