- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā02-06-2022 05:04 AM
Hi,
I want to make only Incident Number available on form, on list, and on reference icon popup view of an Incident table for only specific set of users based on a role.
I have created a "Sys_popup,portal" view accordingly and able to see the only Incident Number on on form, on list, and on reference icon popup.
I have created a role and assigned to few users and written a View Rule to make it available for them based on that role.
However these users are still able to see the default view instead of the newly assigned "Sys_popup,portal" view.
Kindly help me on how can I make the "Sys_popup,portal" view as default to specific users based on a role.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā02-06-2022 10:53 AM
Hi
I have checked this in my PDI and I don't think View Rule is going to work in your scenario. This has been mentioned in below HI article from ServiceNow as well:
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0960698
Solution Approach: I would recommend using an ACL on your table and ACL can control this pretty well.
Let me know if you need a help or have a query on this one.
Hope this helps. Please mark the answer as correct/helpful based on impact.
Regards,
Shloke
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā02-06-2022 10:53 AM
Hi
I have checked this in my PDI and I don't think View Rule is going to work in your scenario. This has been mentioned in below HI article from ServiceNow as well:
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0960698
Solution Approach: I would recommend using an ACL on your table and ACL can control this pretty well.
Let me know if you need a help or have a query on this one.
Hope this helps. Please mark the answer as correct/helpful based on impact.
Regards,
Shloke
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā02-07-2022 11:54 PM
Thank you so much for your help Shloke!!
This requirement has been achieved through the ACL .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-07-2024 06:38 AM
Hi shloke04,
Can you please provide us applicable solution for creating ACL.
I would be helpful to us.
Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā02-06-2022 02:20 PM
Hi
The function "hasRoleExactly()" is not found in "gs." but in "g_user.".
Use in line 3 of your code:
g_user.hasRoleExactly('non mim user role')
see : https://servicenowguru.com/scripting/user-object-cheat-sheet/
Let me know if that answers your question and mark my answer as correct & helpful.
BR
Dirk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā02-06-2022 02:53 PM
View rules run on the server though, not the client, so g_user won't work here. But you're correct in that hasRoleExactly() is not a documented function in the GlideSystem class. The original code may actually work as expected if gs.hasRoleExactly() were replaced with gs.hasRole(). All of that said, an ACL is still the way to go here.