Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Hide impact choice when caller is vip

Mani60
Tera Contributor

Hi All

If the caller of incident is a VIP user then Impact choice "VIP User" should be visible otherwise not visible.

Could you please help me on this to get the proper solution.

 

Thanks

6 REPLIES 6

omkar_jadhav_
Tera Contributor

hi @Mani60 
here are the steps,
go to UI Policy
1) select table (incident)
2) give condition as below

 

 

 

omkar_jadhav__6-1709808955302.png

 

3) write a script

g_form.removeOption('impact','VIP User');
4) save

SourabhAkiwate
Tera Expert

Hello @Mani60 ,

 

Please try below On Change Client Script: 

Field name- Caller

Type- On change

 

function onChange(control, oldValue, newValue, isLoading, isTemplate) {

if (newValue == '') {
g_form.removeOption('impact', '4');
}
var caller = g_form.getReference('caller_id', alert);

function alert(caller) {
if (caller.vip == 'true') {
//alert("calle is VIP");
g_form.addOption('impact', 4, "VIP User");
return true;

} else {
g_form.removeOption('impact', 4);
}

}

//Type appropriate comment here, and begin script below

}

 

 

Please mark my answer as Helpful, if it is useful to you.

Thanks,

Sourabh Akiwate