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

  • Suggested answer
    Obed Miranda Picado Profile Picture
    on at
    RE: How to assign background color to the form grid reference group control ?

    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

  • veeru ogu Profile Picture
    3,851 on at
    RE: How to assign background color to the form grid reference group control ?

    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.

  • Sergei Minozhenko Profile Picture
    23,091 on at
    RE: How to assign background color to the form grid reference group control ?

    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.

  • WillWU Profile Picture
    22,352 on at
    RE: How to assign background color to the form grid reference group control ?

    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.

  • veeru ogu Profile Picture
    3,851 on at
    RE: How to assign background color to the form grid reference group control ?

    D365 version

  • Ludwig Reinhard Profile Picture
    Microsoft Employee on at
    RE: How to assign background color to the form grid reference group control ?

    Good Moring Veer,

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

    Many thanks,

    Ludwig

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,202 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,923 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans