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 :
Microsoft Dynamics CRM (Archived)

Colour Status Bar at Top of Screen that changes with the Status

(0) ShareShare
ReportReport
Posted on by

Hi, does anyone know how I can ass a status bar t the top of the screen that changes according to the status?

So Green for active and Red for Inactive (see below)

6204.Example.png

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at

    Hi Graeme,

    I don't think any supported way to do this. However you can try with unsupported way accessing DOM element.

  • David Jennaway Profile Picture
    14,065 on at

    As per the previous post, there's no supported way to this. Two supported alternatives are:

    1. Display a notification, using the setFormNotification method
    2. Use the entity image, if you're not otherwise using it, and maybe display a red image for inactive records
  • Suggested answer
    Mansoor Sulaiman Profile Picture
    4,330 on at

    The possible option, you can try it out with HTML web resources with colors in it. You have to dynamically load HTML web resources based on your status value.

    If Status Open  - Html web resource with green color If the status is Lost - you can load HTML resource with Red.

    Mansoor

  • Verified answer
    Ivan Burda Profile Picture
    115 on at

    You can add field in header in form with Status across header

    and change color with JS

    function FieldColor() {

       var field = Xrm.Page.getAttribute("Field Name").getValue();

       var element1 = document.getElementsByClassName("Name for this Element")[0];

       if (field == Value for inactive){

       element1.style.background = "#FF7F50";

       }

       else element1.style.background = "#02F226";

    }

    This is how I do it.

    Hope this helps!!

  • Suggested answer
    Community Member Profile Picture
    on at

    Thanks, Ivan.

    I found a similar article online and have deployed the solution already, but this is in essence how I did it.

    I have it running off the Status code so Active or Inactive for now.


    function changecolor() {
    var status = Xrm.Page.getAttribute("statuscode").getValue();

    if (status == '1')
    {
    document.getElementById("Field I want to change the background of").style.backgroundColor = "Green";
    }
    else if (status == '0')
    {
    document.getElementById("Field I want to change the background of").style.backgroundColor = "Red";
    }
    }

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!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
JS-09031509-0 Profile Picture

JS-09031509-0 3

#2
AS-17030037-0 Profile Picture

AS-17030037-0 2

#2
Mark Eckert Profile Picture

Mark Eckert 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans