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

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

Color the grid column depending on other column

(0) ShareShare
ReportReport
Posted on by 144

Hello,

I have 2 data sources, let's say HeaderDS and LineDS. I have a grid that shows HeaderDS with LineDS (with outer join) fields. I have a field F1 from LineDS and F1Color control that should have different background colors depending on the F1 value.

I was trying 2 possible solutions but both of them do not work.

Variant 1:

I have just added a method in displayOption for LineDS.

public void displayOption(Common _record, FormRowDisplayOption _options)
{
    LineDS table;
    table = _record;
    _options.affectedElementsByControl(control_F1Color.id());

    if(table.F1 > 100)
    {
        _options.backColor(WinAPI::RGB2int(#PastelGreen));
    }
    else
    {
        _options.backColor(WinAPI::RGB2int(#PastelRed));
    }
    
    super(_record, _options);
}

But the problem is that it is not invoked when showing the grid.

Variant 2:

To add displayOption for HeaderDS but then I need to find all LineDS records and for each of the display the color field separately.

So, maybe you know how to proceed with that?

I have the same question (0)
  • Verified answer
    Martin Dráb Profile Picture
    237,878 Most Valuable Professional on at

    If you don't mind that the data won't be editable, and easy solution may be using a view. You join tables inside the view and then use this view as a form data source.

  • Suggested answer
    Martin Dráb Profile Picture
    237,878 Most Valuable Professional on at

    If my reply answered your question (as you suggested in another thread), please verify the answer. It's done by Did this answer your question? > Yes in the particular reply.

  • Hidden developer Profile Picture
    144 on at

    Yes, thank you for your help. It works.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 646 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 529 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 285 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans