Hide/show record as per roles
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-15-2016 08:38 PM
I want to hide records who have a specific type( type is field on form) if it is sla then it should be visible only for those users who have a role as sla.
Tried with some acls. now record info is not visible but the 'i' icon is still there and if user clicks that, it redirects to form. it looks like as below:
So in case it is not possible to hide record, atleast after clicking this I icon it should redirect to form only if a user with sla role clicks it. else it shouldn't work for othrt users.
Please suggest how to achieve this.
Thanks in advance
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-15-2016 10:27 PM
Hello Arohi,
Goran is correct here. Please refer below link for server side code.
Getting a User Object - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-16-2016 12:22 AM
Hey Pradeep,
I am trying to do it with brule 'before-query'
Here in this script as in 'type' field is reference field and may be that is not correct way to compare value of reference field in script, its not working. Can you tell me this way can I achieve. pls suggest

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-16-2016 12:30 AM
it should be type.name instead of type in addQuery. Here I am assuming reference record which holds the value has a column name.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-16-2016 07:46 AM
What you can do if you think the query is tough. Go to the list view, make the filter there as you want. Right click and choose copy query.
Then you can use addEncodedQuery(INPUT_QUERY); instead
Can read about it here:
https://wiki.servicenow.com/?title=GlideRecord#gsc.tab=0
//Göran
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-05-2018 01:47 AM
Hi,
Even I have the same kind of requirement...Can you help me how to achieve this!!!