Thursday, March 12, 2020

Lookup for color Picker In Ax 2012

In this blog we will see how to make lookup for color picker in Dynamics Ax 2012. In a grid we will give the drop down for color picker.
  1. Make Int feild in Table 
  2. Add as a datasource of form 
  3. Overide Lookup Mehtrod of the Int feild 

Public void lookup()
{
    #DEFINE.COLORVALUE(64)
    Int r,g,b
    container choosencolor;
    Binary customcolors = new Binary(#COLORVALUE);
    CCColor colorvalue;

    Super();

    [r,g,b] = WinAPI::RGBint2Con(this.backgroundColor());

    chosenColor = WinAPI::chooseColor(element.hWnd(),r,g,b, customColors, true);

    If(chosencolor)
    {
        [r, g, b] = chosencolor;
        Colorvalue = WinAPI::RGB2int(r,g,b);
        This.backgroundColor(colorValue);
        employeeWorkPlannerForm.parmAbsensceColor(colorvalue);
        Employeetable.columns(employeeworkplannerform.numberofcolumns());
        Absenscecolorparm = colorvalue;
    }
}



1 comment:

Please do not add any spam link in the comment box.