VIP Flag Visibility
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2021 05:08 AM
Hi All,
Currently the VIP flag only shows when the VIP is in the “Caller” field, but often raised on behalf of a VIP, so needs to show as a flag on both “Caller” and “On Behalf Of”.
I have checked client script Highlight VIP caller and created similar one for on behalf of with some changes in it. But it is not working . Could you please help here with suggestions.
function onChange(control, oldValue, newValue, isLoading) {
var callerLabel = $('label.incident.u_on_behalf_of');
var callerField = $('sys_display.incident.u_on_behalf_of');
if (!callerLabel || !callerField)
return;
if (!newValue) {
callerLabel.setStyle({
backgroundImage: ""
});
callerField.setStyle({
color: ""
});
return;
}
g_form.getReference('u_on_behalf_of', vipCallerCallback);
}
function vipCallerCallback(caller) {
var callerLabel = $('label.incident.u_on_behalf_of').down('label');
var callerField = $('sys_display.incident.u_on_behalf_of');
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: ""
});
}
}
Regards,
Madhuri
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2021 05:19 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2021 06:14 AM
Hi,
Currently it is showing as true. What does this mean?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2021 06:26 AM
Hi,
When it is false it would allow DOM manipulation
the client script uses DOM manipulation to show the color etc
$ -> means DOM is used
Try to set it false and then re-test
var callerLabel = $('label.incident.u_on_behalf_of');
var callerField = $('sys_display.incident.u_on_behalf_of');
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2021 07:00 AM
Hi Ankur,
I have made it false. Still it is not working . Not highlighting VIP user for on behalf of field. Any other suggetions please.
Thanks.