Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

Set Colour to field Value in MS CRM

(0) ShareShare
ReportReport
Posted on by 15

Hello everybody!

First of all, I don't know if this is the right forum (here in general) to post this type of question.

I would like to set the color of a value of a field (in the view).

I have 2 columns:

- The first is of type booleanType yes/no - 2 options
- And the second is of type LookupType.

I would like the first column when set to "No", the text color of the lookup to have a different color and a bold/font-weight.

How do I style this? I have the following:

function validate(rowData) {

    var str = JSON.parse(rowData);

    var valid = str.acr_valid_Value;    //get first attribute 
    var name = str.acr_name;            //get second attribute

    if (valid._label == 'No') {
        console.log("into in "   name   " change color please!");
    }

}


Then in Asset Views, I choose the column (the second one) to change properties, I choose the web resource that is the .js and I pass it the name of the validate function, which is my case. The example of the function is taken from here.

Thank you.

Andrei

  • andrescr Profile Picture
    andrescr 15 on at
    RE: Set Colour to field Value in MS CRM

    Hi

    Thank you for your help. It's hard to believe how hard MS makes for a simple color change.

    Regards.

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Set Colour to field Value in MS CRM

    Hi andreicr,

    Maybe you can try to use PCF controls--Colorful Optionset Grid(Colorful Optionset Grid | PCF Gallery).

    Using this control, you can show the OptionsSets using the colors customized using the standard experience. Starting with the release 8, the ColorfulOptionsetGrid works also for Boolean/TwoOptions and for MultiSelectOptionset/MultiSelectPicklist.

    You can download zip file:Release Release 8 - boolean and multipleOptionSets · brasov2de/ColorfulOptionsetGrid · GitHub

    Then you can refer Guidance Notes to customize view as your need:GitHub - brasov2de/ColorfulOptionsetGrid

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,391 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans