Restrict Tab/Section on Incident Form

kevinthury
Tera Guru

We have created a Section on the Incident form called 'Record Owner Info'.   This section contains six custom fields.   Is there a way to restrict the visibility of this tab to just our Service Desk?   We have 'read' ACLs to hide the six fields, but would like to go a step further and hide the whole tab if possible.

find_real_file.png

1 ACCEPTED SOLUTION
9 REPLIES 9

I believe g_form.getValue('assignment_group') will return the sys_id of the group so you will need to put != 'sys_id of the group'.


Hey Brian


My bad, thanks for the update



Please mark my response as correct and helpful if it helped solved your question.
-Thanks

benn23
ServiceNow Employee
ServiceNow Employee

Use a display Business Rule to set a scratchpad variable (ex: g_scratchpad.isServiceDesk = gs.getUser().isMemberOf('Service Desk');   )


Then use an onLoad client script to read that scratchpad variable:



function onLoad(){


if(g_scratchpad.isServiceDesk){


g_form.setSectionDisplay('record_ownerinfo', false);


}


}


Steven G_
Tera Expert

Hi Kevin,



the safest way to secure fields are by creating field level ACL for read and write, You can create a custom role for the support center group and then create the ACL based on that role, this will make it so you do not run a client script and it does not slow down your form load. You always want to keep in mind if you develop something you want to keep in mind what your future state may look like. In this use case, I believe ACL will be best. Client script could work also but user could possibly still edit the fields on alist view. Hope this helps


kevinthury
Tera Guru

Thanks for everyone for their responses.   Reading these convinces me there is more than one way to accomplish my goal.   My approach was based on content from how to hide related list tab in incident form??.



I created a client script as noted in the image below which worked for our needs.



find_real_file.png