Question on impact choice

Mani60
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,
1 REPLY 1

Sohail Khilji
Kilo Patron
Kilo Patron

Why not try with UI Policy and Script section ?

 

Create a UI policy with a conditio as Caller.VIP is True.

Then in the script condtion of 'true' enter the code as below:

 

g_form.removeOption('impact', 9);
 
I hope this helps...

☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect