Sunday, August 2, 2015

How to change grid row color in listpage/form in Dynamics Ax 2012

Hello Guys...!

Problem

How to change grid row color in listpage/ form in Dynamics Ax 2012 ?

Solution :

Go to Form Datasource and override Displayoption() method and write code according to your requirement.

Example :

 public void displayOption(Common _record, FormRowDisplayOption _options)
{
    SalesTable prodtablelocal;
   
    prodtablelocal = _record;
   
    Switch(prodtablelocal.SalesStatus)
    {
    Case SalesStatus::Delivered:
    _options.backColor(65535); //Light Yellow
    //_options.affectedElementsByControl(Salestable_SalesId.id());
    Break;
    Case SalesStatus::Invoiced:
    _options.backColor(8421631); //Light Red
    //_options.affectedElementsByControl(Salestable_SalesId.id());
    Break;
    Case SalesStatus::Backorder:
    _options.backColor(65408); //Light Green
    //_options.affectedElementsByControl(Salestable_SalesId.id());
    _options.textColor(12582912);
    Break;
    }
}



@Rahul Talasila

No comments:

Post a Comment

Why do users often get confused about Dynamics 365 Customer Engagement (D365 CE), Dataverse, and the Power Platform?

  The Microsoft ecosystem for business applications can sometimes be difficult to navigate, especially when discussing Dynamics 365 Customer...