Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM forum
Answered

Need change the colour of text field value in Dynamics 365

Posted on by 340

Hi Team,

I got to know there is no supported way to  colour of text field value in Dynamics 365 .

Is there any unsupported way for it?

  • Mekala Profile Picture
    Mekala 5 on at
    RE: Need change the colour of text field value in Dynamics 365

    Hi

    Could you explain where I have to save the code and how I ll call the code in power automate to achieve that.

  • GRedhead Profile Picture
    GRedhead 270 on at
    RE: Need change the colour of text field value in Dynamics 365

    I have the same request, did you get this working?

  • Sundharrajan Profile Picture
    Sundharrajan 5 on at
    RE: Need change the colour of text field value in Dynamics 365

    Hi all,

    First way:

    I have tried this code => parent.$("[tag:name]_i").css("color", "red");

    but [tag:name] indicates the name of field, not display name. Example:Account name is display name, Name of field is 'name'.

    code is working, but it was displayed no result.

    I am tried another way:

    code => window.parent.document.getElementById("textFieldLogicalName").style.color='red';

    In this code,it displayed the error message as "Cannot read property 'style' of null".

    both codes are writing in web resources Dynamics 365 and its Legacy rendering may get turned on.

    Please suggest any solutions for change the label colors and section heading colors also.

    Thank you,

    SUNDHARRAJAN A

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Need change the colour of text field value in Dynamics 365

    Hi, Thanks for posting

    I tried your code it's working, changing the color of "name" field data.

    but I want to change the color of the "name" field data background color also.

    so if you have any code for my requriment please send me the code to my mail id "prabha.ms47@gmail.com"

    Regards,

    PrabhaHere i want to change varma background color as red and phone as greend

  • AmirHaleem Profile Picture
    AmirHaleem 5 on at
    RE: Need change the colour of text field value in Dynamics 365

    Hello, i tried the following and it is working

    parent.$("[data-for-id='name_label']:first-child").css("color", "red");
    parent.$("#name_i").css("color", "red");

    but it is changing the text written inside the field only however i need to change also the background color of the field. Thanks.

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,321 Most Valuable Professional on at
    RE: Need change the colour of text field value in Dynamics 365

    I haven't checked that for picklists but you can try it.

  • Suggested answer
    Amiy  Profile Picture
    Amiy 340 on at
    RE: Need change the colour of text field value in Dynamics 365

    Thanks Andrew . The code is working perfectly .

    Does it also works for the option set value?

  • a33ik Profile Picture
    a33ik 84,321 Most Valuable Professional on at
    RE: Need change the colour of text field value in Dynamics 365

    Have you tried what I posted?

  • Amiy  Profile Picture
    Amiy 340 on at
    RE: Need change the colour of text field value in Dynamics 365

    Its still not working .

  • Suggested answer
    Nithya Gopinath Profile Picture
    Nithya Gopinath 17,074 on at
    RE: Need change the colour of text field value in Dynamics 365

    Hi Amiy,

    Use the code below.

    function ChangeBackground()
    {
     window.parent.document.getElementById("fieldname").style.color='red';
    }

    Hope this helps.

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 9th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

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

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,277 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,135 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans