Coloring records

The possibility to color individual records is one Dynamics AX feature that can improve user experience. Normally, people like to see a reasonable number of colors in the interface they use. This makes their daily tasks not so boring. One of the common requests is to emphasize the importance of disabled records, for example, terminated employees or stopped customers by displaying their records in a different color, normally red. An opposite example could be to show processed records like posted journals or invoices sales orders, let’s say in green. In this recipe, we will color locked-in-journal accounts in the Chart of accounts form.
How to do it…

1. In AOT, open the LedgerTableListPage form and override the displayOption()
method in its LedgerTable data source with the following code:
public void displayOption(
Common _record,
FormRowDisplayOption _options)
{;
if (_record.(fieldnum(LedgerTable,BlockedInJournal)))
{
_options.backColor(WinAPI::RGB2int(255,100,100));
}
super(_record, _options);
}
2. To test the coloring, open General ledger | Places | Chart of Accounts and notice
how locked-in-journal accounts are displayed now in a different color:
How it works…
The method displayOption() on any form’s data source can be used to change some
of the visual options. Every time, before displaying the record, this method is called
by the system with two arguments; the first is the current record and the second is a
FormRowDisplayOption object, whose properties can be used to change record visual
settings. In this example, we check if current ledger account record is locked in journal and if
yes, we change the background property to light red by calling backColor().
Source
Microsoft Dynamics AX 2009 Development Cookbook Dec 2009

0 thoughts on “Coloring records

Bir yanıt yazın

E-posta adresiniz yayınlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir

Dijital Dönüşümünüzü AI İle Hızlandırın

Dynamics 365 ve AI destekli çözümlerle iş süreçlerinizi optimize edin, verinizi anlamlı içgörülere dönüştürün ve büyümenizi sürdürülebilir hale getirin.

AI-Ready Enterprise Partner

Microsoft Dynamics 365 ve yapay zekâ çözümleriyle kurumsal sistemlerinizi güçlendirir, operasyonel karmaşıklığı azaltır ve geleceğe hazır bir mimari tasarlarız.

DMR Göztepe Merkez Ofis

Eğitim Mah. Hızırbey Cad. No:118/5 D:1 Kadıköy İstanbul

Marmara Üniversitesi Göztepe Kampüsü Teknopark

Tel: +90 216 470 79 49

E-posta: info@dmrbt.com

DMR Başıbüyük Ofis

Başıbüyük Mahallesi Süreyyapaşa Başıbüyük Yolu Sk. No: 4/7 Maltepe İstanbul

Marmara Üniversitesi Başıbüyük Kampüsü Teknopark

Tel: +90 216 470 79 49

E-posta: info@dmrbt.com