RSS

Category Archives: Grid Coloring

Fill color in Grid records based on condition flag in AX

My client requirement was to change the grid row’s color in dynamics ax 2012 on the condition basis.

There is a method displayOption() method on a form data source which can be useful to highlight particular rows on grid, based on the data in the record. displayOption() method will execute once for each record before the record is displayed on the form.

public void displayOption(Common _record, FormRowDisplayOption _options)
{
 #define.DeepSkyBlue(0, 191, 255)

 if (_record.(fieldnum(ProdTable,ProdStatus))==ProdStatus::ReportedFinished)
 {
 _options.backColor(WinAPI::RGB2int(#DeepSkyBlue));
 }

 super(_record, _options);
}

Happy Daxing 🙂

Reference :
Highlighting record in Grid

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

Advertisements
 

Tags: , , , , , , , ,