Hide the catalog items fields from enduser

harsha vv
Tera Contributor

I want to hide catalog items fields from enduser can give me the code for this

13 REPLIES 13

A user who doesn't have any role

Hi,
You can write a onLoad client script as below

 


function onLoad() {
   //Type appropriate comment here, and begin script below
   var rr=g_user.getRoles()
if(rr.length==0)
{
g_form.removeOption("subcategory",'option1');
g_form.removeOption("subcategory",'option2');
}

}

 



GlideForm | ServiceNow Developers

 

 


Thanks and Regards,

Saurabh Gupta

I have tried it is not working and one more thing is my subcategory options are in choice table

Hi,
Can you please alert the rr variable?

 

 


Thanks and Regards,

Saurabh Gupta

I didn't understood