Friday, October 10, 2014

Coloring Grid based on data value in ax 2012


**********Line amount coloring**********
run method of form
                 amt = TotalLineAmount.realValue();
                   // if( amt <0.00)
                {
                    TotalLineAmount.colorScheme(FormColorScheme::RGB);
                    TotalLineAmount.foregroundColor(WinAPI::RGB2int(255,0,0));
                    }
--------------------------------------
colring of grid

public void displayOption(Common _record, FormRowDisplayOption _options)
{
   //CustQty  cqty;
    //RecId   rid;
    CustQty cqty = _record;
      //select cqty where cqty.RecId == rid;
    if (cqty.Qty >=3)
    {
        _options.backColor(WINAPI::RGB2int(50, 250, 50));
       
    }
    else if( cqty.Qty <=3)
    {
         _options.backColor(WINAPI::RGB2int(247, 23, 23));
    }
    Super(_record,_options);

}

No comments:

Post a Comment

Copy Markup charges while posting purchase invoice using X++

 Copy Markup charges while posting purchase invoice using X++ Class: Important: Code logic is just for Reference.  New class => Duplicate...