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

Notifications

Announcements

No record found.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans