Incident Impact choice "Vip User" can't visible for non vip user

suru2
Tera Contributor

Hi All,
I have one requirement on incident form when the caller is vip user then only he is able to see that impact choice "vip user" and when call is not vip then he cant able to see that impact choice "vip user", so here i have written one client callable script include and call that script include in the client script and tested that but it is not working as expected.
please find attached code which i have written :

 

Script Include Code:

 

var Detailsuser = Class.create();
Detailsuser.prototype = Object.extendsObject(AbstractAjaxProcessor, {

checkCaller: function()
{
var caller = this.getParameter("sysparm_caller_id");
var user = new GlideRecord('sys_user');
user.get(caller);

return user.vip.toString();
},

    type: 'Detailsuser'
});
 
 
Client script code :
 
var ga = new GlideAjax('Detailsuser');
ga.addParam('sysparm_name', 'checkCaller');
ga.addParam('sysparm_caller_id', newValue);
ga.getXML(getResponse);
function getResponse(answer) {
alert(answer);
if (answer ==true) {
g_form.removeOption('impact', 9);
} else {
g_form.addOption('impact', '9','VIP User');
}

}
}
 
Can anyone please help me on this to get the proper solution.
 
Thanks,
 
 
 
 
 
 
 
 
 
 
 
0 REPLIES 0