Highlight VIP badge if Requested for user is VIP in Requested Item form.

Deepak Shaerma
Kilo Sage

Hi community,  

 

I have a requirement that if we select the Caller in Incident form and the user is VIP, then we see VIP Badge and color seems to be red. Same we have to implement for the Requested Item form. Can anyone help me in doing this configuration in servicenow. Appreciate all your help. 

 

 

Regards 

DEEPAK SHARMA

5 REPLIES 5

Sandeep Rajput
Tera Patron
Tera Patron

@Deepak Shaerma This is already an OOTB behaviour for VIP users https://docs.servicenow.com/bundle/washingtondc-it-service-management/page/product/incident-manageme... isn't this working in your case?

Hi @Sandeep Rajput 

 

I checked that OOTB has one client script , business rule and one record in sys_ui_style table with name, client script = Highlight VIP Caller, BR = Set scratchpad. By these combinations, VIP is populated. But i need how to configure that exact implementation on RITM form level. 

@Deepak Shaerma OOTB there is an onChange client script Highlight VIP Caller which runs on the caller field.

 

function onChange(control, oldValue, newValue, isLoading) {
	var callerLabel = $('label.incident.caller_id');
	var callerField = $('sys_display.incident.caller_id');
	if (!callerLabel || !callerField)
		return;
	
	if (!newValue) {
		callerLabel.setStyle({backgroundImage: ""});
		callerField.setStyle({color: ""});
		return;
	}
	g_form.getReference('caller_id', vipCallerCallback);
}

function vipCallerCallback(caller) {
	var callerLabel = $('label.incident.caller_id').down('label');
	var callerField = $('sys_display.incident.caller_id');
	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: ""});
	}
}

 

You can write the similar script on requested for field on the RITM table and highlight the VIP status of the user.

 

Hope this helps.

Brian Sorensen
Giga Guru

In my instance, we set this flag from FALSE to TRUE on the users table

BrianSorensen_0-1720542370612.png

 

By default it then gives us this on the incident view

BrianSorensen_1-1720542430889.png

 

and in the Incident we see the caller in RED text

BrianSorensen_2-1720542470848.png

 

 

This only impacts Incident though, I have not looked at Requested Items