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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

How to assign background color to the form grid reference group control ?

(0) ShareShare
ReportReport
Posted on by 3,851

I have setup form , there i am setting my color code through color picker.

In my custom form i am using that setup data to apply the background color to my reference group control in display option method.

but it is not showing the color, is there any specific way to apply the color to the reference group control.

If i take string control it is working fine.

please  the code below.

public void displayOption(Common _record, FormRowDisplayOption _options)
{
 SurveyTable surveyDis = _record;


_options.affectedElementsByControl(GridHeader_RiskLevelRecid.id());


if (surveyDis.AsbestosStatus)
{
_options.backColor(StatusTable::find(surveyDis .AsbestosStatus).ColourCode);
}

super(_record, _options);
}

Thanks in advance,

Veer

I have the same question (0)
  • Ludwig Reinhard Profile Picture
    Microsoft Employee on at

    Good Moring Veer,

    Can you provide us some information on the AX / D365 version that you operate?

    Many thanks,

    Ludwig

  • veeru ogu Profile Picture
    3,851 on at

    D365 version

  • WillWU Profile Picture
    22,363 on at

    Hi veeru,

    Try the following code:

    Element.colorScheme(FormColorScheme::RGB);

    Element.backgroundColor(WinAPI::RGB2int(255,225,125));

    Refer to the DOC:

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

    Hope this helps.

  • Sergei Minozhenko Profile Picture
    23,097 on at

    Hi Veeru,

    Some of these features were deprecated in D365. At least, I was able only to color the whole grid line, but I haven't managed to make affectedElementsByControl works.

  • veeru ogu Profile Picture
    3,851 on at

    we can  make  affected by controls it is working  for string  and not working for reference group control.

    In  a same grid  two  different columns  has to assign two different colors based  on color setup in my setup forms.

  • Suggested answer
    Obed Miranda Picado Profile Picture
    Microsoft Employee on at

    Hello Veeru, as was already suggested on this thread, would you be able to give it a try to the information on https://docs.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/user-interface/specify-color-font-background-controls

    If this was already tried, what was the output? also, as someone already mentioned some process deprecates with the time

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 Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

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

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 671

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 621 Super User 2026 Season 1

#3
Abhilash Warrier Profile Picture

Abhilash Warrier 589 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans