How to Open Color Selectable Window in Ax 2012

Description:-

Colour Window is nothing but where you can select color and apply for different purpose. A macro is a variable known to the precompile. The variable can have a value that is a sequence of characters, but it is not required to have a value. The #define directive tells the precompile to create the macro variable, including an optional value.

You need in sometimes to colorize specific rows with different color to do anything in your business rule. Here is the Demo Example for Selecting Colorvalue from Color Window and use after that where you want to use in form or in for changing columns or Rows color in Grid or any other else purpose in form. Here I have Created Job for Selecting Color value and Display in Infolog.

Code:-

static void colors(Args _args)
{
    #DEFINE.COLORVALUE (64)
    int             r, g, b;
    container       chosenColor;
    Binary          customColors        = new Binary(#COLORVALUE);
    CCColor         colorValue;
    chosenColor = WinAPI::chooseColor(infolog.hWnd(), r, g, b, customColors, true);
    if (chosenColor)
    {
        [r, g, b] = chosenColor;
        colorValue  = WinAPI::RGB2int(r, g, b);
        Box::info(strFmt("Color Value : %1",colorValue));
    }
}


Related Posts

Previous
Next Post »

Thanks for comments.....