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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Suggested Answer

Change field color

(0) ShareShare
ReportReport
Posted on by 87

Hi guys,

I want to change the color of the field in the invoice when it has data. for example, it converts to red. what code should I use for it?

Thanks you

I have the same question (0)
  • Suggested answer
    CRMJetty Profile Picture
    3,514 on at

    Hello,

    You can refer this,

    https://community.dynamics.com/crm/f/microsoft-dynamics-crm-forum/201427/change-a-color-of-text-field-value/670102

    Or,You can try this code,

    window.parent.document.getElementById("field_c").style.backgroundColor = "red";

    I hope it helps,

    Thanks.

    Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365

  • Suggested answer
    Pawar Pravin Profile Picture
    5,237 on at

    Hi Amin,

    You can do it using unsupported way in JavaScript

    Please refer below code for more details:

    balugajjala.wordpress.com/.../

  • Suggested answer
    Mustajab Profile Picture
    40 on at

    Hi Amin,

    Yes, it can be definitely done as we can see in our earlier comments. But it has a down that is performance. As with a lot of legacies JS commands getting depreciated (Article) I feel it is not right to build our client-side validations using such commands. 

    Alternatively, I would suggest using the formcontext.ui.setformNotification (article). You can use the info in which you can required text that invoice has amount. The benefit of it is that is supported on the Unified interface (UI) as well.

    Thanks,


    Mustajab

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
Mallesh Deshapaga Profile Picture

Mallesh Deshapaga 32

#2
ManoVerse Profile Picture

ManoVerse 31 Super User 2026 Season 1

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 31 Most Valuable Professional

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans