VIP Caller with red font color (Incident Table)

Elton2
Tera Contributor

Hi everyone, how are you?!


Every time a VIP user opens an INC, it must have the “VIP” icon and the font color “Red” (img1).


Note that I have already defined the user “Enzo” as VIP (img2), but when I access the Incident record, the font color is not Red (img3).

 

There is the option to right-click on the “Caller” field > Configure Styles (img4) (img4.1), but even defining “color: red” or “color: red !important” does not work.

 

Note: I tried using a Client Script (Incident table), but it does not work (img5)

    function onLoad() {
        var vipCallerName = g_form.getValue('caller_id');
        if (g_form.getValue('caller_id.vip') == 'true') {
            vipCallerName.style.color = 'red';
        } else {
            vipCallerName.style.color = '';
        }
    }

 

Obs.:  I also found this tip in the Community but it doesn't work:

https://www.servicenow.com/community/itsm-forum/change-font-color-to-red-for-caller-with-a-true-vip-...

 

Does anyone have any tips? please!

 

Thanks 😉

 

2 ACCEPTED SOLUTIONS

Harish Bainsla
Kilo Patron
Kilo Patron

Hi @Elton2  check below script I try on pdi its working

function onLoad() {
//Type appropriate comment here, and begin script below
var caller = gForm.getReference('caller_id', function(caller) {
if (caller.vip == 'true') {
gForm.setDisplayValue('caller_id', caller.name + ' (VIP)');
// Apply red font
var fieldElem = document.getElementById('label.caller_id');
if (fieldElem) {
fieldElem.style.color = 'red';
fieldElem.style.fontWeight = 'bold';
}
}
});
}

View solution in original post

Hi @Elton2 

It appears to be an OOB feature where selecting a VIP user as the caller automatically changes the font color to red and displays the VIP logo in front of the field by default.

I recommend raising a HI ticket with the vendor.

 

Pic from fresh PDI.

Screenshot_20250622-184624.png

Regards,

Siva

View solution in original post

13 REPLIES 13

@Elton2 

I'm good. Thanks.

Hope you too..

Elton2
Tera Contributor

Hi @J Siva ,

I Accepted both solutions.
Thank you very much! 😉

Harish Bainsla
Kilo Patron
Kilo Patron

Hi @Elton2  check below script I try on pdi its working

function onLoad() {
//Type appropriate comment here, and begin script below
var caller = gForm.getReference('caller_id', function(caller) {
if (caller.vip == 'true') {
gForm.setDisplayValue('caller_id', caller.name + ' (VIP)');
// Apply red font
var fieldElem = document.getElementById('label.caller_id');
if (fieldElem) {
fieldElem.style.color = 'red';
fieldElem.style.fontWeight = 'bold';
}
}
});
}

Elton2
Tera Contributor

Hi @Harish Bainsla , how are you?! 😉


I'd like to thank you for your support!!! 👏

 

I tried using here: g_form.setReadOnly('caller_id', true); but without success!
Note: Is it possible to make this color red when the field is "Read Only"  

function onLoad() {

    //Type appropriate comment here, and begin script below

    var caller = gForm.getReference('caller_id', function(caller) {

Note        if (caller.vip == 'true') {

            g_form.setReadOnly('caller_id', true); //because the resolver will not be able to edit

            gForm.setDisplayValue('caller_id', caller.name + ' (VIP)');

            // Apply red font

            var fieldElem = document.getElementById('label.caller_id');

            if (fieldElem) {

                fieldElem.style.color = 'red';

                fieldElem.style.fontWeight = 'bold';

            }

        }

    });

}

Note: I have attached 2 images as an example.

 

Thanks again for your support!!! 👍

Hi @Elton2 you have written wrong  gForm.setDisplayValue('caller_id', caller.name + ' (VIP)'); instead of it correct with below line

 

g_form.setDisplayValue('caller_id', caller.name + ' (VIP)');

 

if my answer helps you mark helpful and accept solution