- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2018 08:23 PM
Hi all. I'm very new to ServiceNow, still configuring for our go live on Kignston.
We have the VIP Caller setup and it works fine for New Incidents. However we also have a field on the form called Affected Person (u_affected_user, reference User (sys_user).
How can I have this field also show the VIP icon and Text Red?
The idea being anyone may log a call for the CEO or other VIP (Affected Person) so we want this highlighted.
I copied the Client Script "Highlight VIP Caller" and pointed it at the Affected Person field but nothing changes.
Any help would be much appreciated.
Thanks
David
Solved! Go to Solution.
- Labels:
-
Instance Configuration
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2018 09:52 PM
If you have copied the Same Client script then below changes is mandatory in new script.
1.On change client script should be written on u_affected_user.
2.Replace 'label.incident.caller_id with 'label.incident.u_affected_user'.
3. Replace 'g_form.getReference('caller_id', vipCallerCallback)' with g_form.getReference('u_affected_user', vipCallerCallback).
4.Replace sys_display.incident.caller_id with 'sys_display.incident.u_affeted_user'.
5.In the sys_user form VIP check box should be checked.
Hit Helpful or Correct on the impact of response.
-Tushar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2018 09:52 PM
If you have copied the Same Client script then below changes is mandatory in new script.
1.On change client script should be written on u_affected_user.
2.Replace 'label.incident.caller_id with 'label.incident.u_affected_user'.
3. Replace 'g_form.getReference('caller_id', vipCallerCallback)' with g_form.getReference('u_affected_user', vipCallerCallback).
4.Replace sys_display.incident.caller_id with 'sys_display.incident.u_affeted_user'.
5.In the sys_user form VIP check box should be checked.
Hit Helpful or Correct on the impact of response.
-Tushar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-17-2018 02:48 PM
Thank you Tushar this works a treat, you just made my day 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-16-2020 09:08 AM
David,
Do you have the code you can provide me? I need to do the same thing.
Thanks,
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2020 07:43 AM
Hi Tushar,
I tried the same but didn't work. Can you please suggest?
I have a filed called u_manager.
Below is the script.
function onChange(control, oldValue, newValue, isLoading) {
var callerLabel = $('label.incident.u_manager');
var callerField = $('sys_display.incident.u_manager');
if (!callerLabel || !callerField)
return;
if (!newValue) {
callerLabel.setStyle({backgroundImage: ""});
callerField.setStyle({color: ""});
return;
}
g_form.getReference('u_manager', vipCallerCallback);
}
function vipCallerCallback(caller) {
var callerLabel = $('label.incident.u_manager').down('label');
var callerField = $('sys_display.incident.u_manager');
if (!callerLabel || !callerField)
return;
//check for VIP status
if (caller.vip == 'true') {
var bgPosition = "95% 55%";
if (document.documentElement.getAttribute('data-doctype') == 'true')
bgPosition = "5% 45%";
callerLabel.setStyle({backgroundImage: "url(images/icons/vip.gif)", backgroundRepeat: "no-repeat", backgroundPosition: bgPosition, paddingLeft: '30px' });
callerField.setStyle({color: "red"});
} else {
callerLabel.setStyle({backgroundImage: ""});
callerField.setStyle({color: ""});
}
}