Major Incident Management Field Icon

raishiveshk
Tera Contributor

Hello Everyone reading this..

I wants to add a danger icon/image in Incident record inside the 'Number' field(just right to numbers), whenever the incident state will be major incident accepted so that it can get differ from the P1/any other incidents. What's the best way to acheive this. Please make sure I wants that inside the field only neither on left nor on right.

Thanks for your help in advance.

1 ACCEPTED SOLUTION

GlideFather
Tera Patron

Hi @raishiveshk,

can you please provide more details?

 

Are we talking about form or list view? Each requires a bit different solution.

 

List view > Field Styles

  • you can get inspiration from this:

GlideFather_0-1760353921760.png

Looks like this:

GlideFather_1-1760353987183.png

 

For the form, it will require an onLoad client script

  • you can get inspiration from this
function onLoad() {
    setTimeout(function() {
        var fieldName = 'mood_score_tw';
        var mstw = g_form.getValue(fieldName);
        var control = g_form.getControl(fieldName);
        control.style.color = 'black';
        control.style.fontWeight = 'bold';
        var bgColor = '';
        if (mstw === 'Green') {
            bgColor = '#b6fcb6';
        } else if (mstw === 'Yellow') {
            bgColor = '#fff9b1';
        } else if (mstw === 'Red') {
            bgColor = '#fcb6b6';
        }
        control.style.backgroundColor = bgColor;
        if (control.parentNode) {
            control.parentNode.style.backgroundColor = bgColor;
        }
    }, 300);
}

GlideFather_2-1760354049780.png

 

and it looks like this:

GlideFather_3-1760354135221.png

 

 

 

So, find the danger icon or select existing one in the system and use it in the Field styles for list view, or onLoad CS in form view. Both can have specific conditions using JavaScript.

 

Let me know if this helps you and feel free to discuss more details,

 

 

———
/* If my response wasn’t a total disaster ↙️ drop a Kudos or Accept as Solution ↘️ Cheers! */


View solution in original post

3 REPLIES 3

GlideFather
Tera Patron

Hi @raishiveshk,

can you please provide more details?

 

Are we talking about form or list view? Each requires a bit different solution.

 

List view > Field Styles

  • you can get inspiration from this:

GlideFather_0-1760353921760.png

Looks like this:

GlideFather_1-1760353987183.png

 

For the form, it will require an onLoad client script

  • you can get inspiration from this
function onLoad() {
    setTimeout(function() {
        var fieldName = 'mood_score_tw';
        var mstw = g_form.getValue(fieldName);
        var control = g_form.getControl(fieldName);
        control.style.color = 'black';
        control.style.fontWeight = 'bold';
        var bgColor = '';
        if (mstw === 'Green') {
            bgColor = '#b6fcb6';
        } else if (mstw === 'Yellow') {
            bgColor = '#fff9b1';
        } else if (mstw === 'Red') {
            bgColor = '#fcb6b6';
        }
        control.style.backgroundColor = bgColor;
        if (control.parentNode) {
            control.parentNode.style.backgroundColor = bgColor;
        }
    }, 300);
}

GlideFather_2-1760354049780.png

 

and it looks like this:

GlideFather_3-1760354135221.png

 

 

 

So, find the danger icon or select existing one in the system and use it in the Field styles for list view, or onLoad CS in form view. Both can have specific conditions using JavaScript.

 

Let me know if this helps you and feel free to discuss more details,

 

 

———
/* If my response wasn’t a total disaster ↙️ drop a Kudos or Accept as Solution ↘️ Cheers! */


Hi @raishiveshk,

 

have you had chance reviewing my message above? To comply with the Community's Code of Conduct, it'd be nice to hear some feedback from you.  It's a result of efforts taken in my free time...

 

Thanks

———
/* If my response wasn’t a total disaster ↙️ drop a Kudos or Accept as Solution ↘️ Cheers! */


Hello @GlideFather 

Actually, it's been sorted by myself before your reply with some research over the Internet. But still the solution I had used was somehow same as you had written so I have marked your response helpful and accepted as solution. Thanks for your efforts and time.