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, ...
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,361 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,093 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
    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

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