web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

paint records in different colors

(0) ShareShare
ReportReport
Posted on by 1,288

Hello everyone,

I'd like my form records to be painted in different colors depending on the records values in the grid. What is the best place for such change? init() on form datasource? What is the best approach?

Thanks.

  • Verified answer
    Mariano Gracia Profile Picture
    on at

    use the form data source displayOption method, it has two parameters, the first one is the record, the second one is a FormRowDisplayOption wich you can use to change the back color based on the values of the first parameter

  • Suggested answer
    ergun sahin Profile Picture
    8,826 Moderator on at

    I haven't tested it, but if I'm not mistaken, we cannot use grid color in d365fo.

    With htmlviewer, the table can be created and painted manually, but I'm not sure if it's worth it.

    Instead, an field can be added to help visually perceive it.

  • Verified answer
    ergun sahin Profile Picture
    8,826 Moderator on at

    I came across an example below. I think my information is a bit old

    d365technext.blogspot.com/.../gridlist-row-color-change-using-method.html

  • huijij Profile Picture
    19,813 on at

    Hi Azat,

    As mentioned,you can add colors to a form control of a standard or custom form by using event handler method “OnDisplayOptionInitialize“ :

    docs.microsoft.com/.../specify-color-font-background-controls

    allaboutdynamic.com/.../

    regards

  • dark_knight Profile Picture
    1,288 on at

    form data source displayOption method worked like a charm for me. Thanks for your answers.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 245 Super User 2026 Season 2

#2
Aayush Tiwari Profile Picture

Aayush Tiwari 227

#3
Subra Profile Picture

Subra 184 Super User 2026 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans