Sunday 2 August 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

Adding a newline into a string in C# and X++

Below is the sample code we can use for  adding a newline after every occurrence of "@" symbol in the string in C#   using System...