AX / D365FO – Change the text colour of a Form field using X++

This example shows how to change the text colour of a Form control through X++ code. The color will be changed in RED

TextControl.colorScheme(FormColorScheme::RGB);
TextControl.foregroundColor(WinAPI::RGB2int(255,0,0));

And this will be the result

If you want to convert to GREEN just modify like shown below

TextControl.colorScheme(FormColorScheme::RGB);
TextControl.foregroundColor(WinAPI::RGB2int(0,128,0));

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 )

Facebook photo

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

Connecting to %s