How to hide New and Edit button based on roles. Urgent!!!!!

madanm2103
Kilo Explorer

Hi All,

 

I need to hide New and Edit button for problem creator role in the Problem Task related list in Problem form.

I tried all the possible ways but still not working.

PLease help me on this.

 

Thanks,

Madan

22 REPLIES 22

m_servicenow
Kilo Contributor

Madan,


Go through the below link. This will help u out. use



http://wiki.servicenow.com/index.php?title=UI_Actions#Controlling_Visibility_with_Roles



For Example:


Use following script in UI action condtion.



gs.hasRole('itil_incident') || gs.hasRole('itil_problem')


Hi Mukesh,



I have already tried this but of no use....


Hi Madan,



The simplest way should be to use List Control and add the specific roles that are allowed access. Failing that you could do what Mukesh mentioned and replace the standard UI actions with your own (use the same action name so that the original buttons are over ridden). On your replacement UI actions, modify the visibility conditions to require specific roles (gs.hasRole('itil_incident') || gs.hasRole('itil_problem')) and change the table to Problem (so it doesn't affect any other tables). If this didn't work for you the first time, check the roles on the user you are trying to exclude as they might have additional roles (e.g admin).