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

Convert Call stack to readable format in D365FO X++

//Input --container _xppCallStack = xSession::xppCallStack();  Public static str POL_formatXppCallStack(container _xppCallStack, int _skipFr...