Highlight VIP caller
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-04-2018 08:55 AM
Hi Everyone,
As we know, that we have an OOB feature called "Highlight VIP Employee" used in incident form or hr case forms. We have a requirement to have the same functionality which is - " In the list view have VIP icon/image beside the opened_by field on chat records.(This i was able to achieve, by assigning a new style to it and it worked). When i open a chat record i want to highlight the person's name in the "opened_by" field to "Red color" as we see on the incident or hr case forms. I have applied a client script -
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
g_form.getReference('opened_by',setColor);
}
function setColor(openedby) {
var openedbyField = g_form.getElement('sys_display.' + g_form.getTableName() + '.opened_by');
if (openedby.vip == 'true')
openedbyField.setStyle({color : "red"});
else
openedbyField.setStyle({color : ""});
}
But its not working. Any suggestions?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-19-2025 04:20 AM
I tried this script but it gave me this error, any suggestions on this ?
I need to create a custom field called "on behalf of" on incident table and make it behave exactly like "caller" behaves(VIP flag & red colour) if VIP user is selected.
onChange script error: TypeError: $ is not a function function () { [native code] }

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-04-2018 09:27 AM
Use Field Styles.
why are you using Client Script?
OOB Feature uses Field Styles.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-04-2018 09:33 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-04-2018 09:34 AM
PFA

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-29-2019 05:19 AM
Over the last few versions of ServiceNow, I'm not sure when it started, the Style for VIP doesn't work on the form. You need a corresponding client script to do the work. There's an out of the box one on Incident called "Highlight VIP Caller". You also have to make sure that the Client Script property "Isolate script" is set to false. It's not on the form, so you either have to add it there, or just add it to the list and edit it there.