Notifications
Announcements
No record found.
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)
*This post is locked for comments
Hi Graeme,
I don't think any supported way to do this. However you can try with unsupported way accessing DOM element.
As per the previous post, there's no supported way to this. Two supported alternatives are:
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
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!!
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
SA-08121319-0 4
Calum MacFarlane 4
Alex Fun Wei Jie 2