Form Views & View rules
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2022 11:50 AM
Hi I would like non admin/non group members to only have one view on Project, while allowing admin/group members to be able to select other views. How can I achieve this?
I tried an advanced view rule(shown below and variations of this), this does prevent non admin/non group users from selecting the default view, but they are still able to select the other views such as waterfall/business case view.
(function overrideView(view, is_list) {
if (gs.hasRole('admin') || gs.getUser().isMemberOf('PMO IT Admin')) {
answer = 'NULL';
} else {
answer = 'Customer_View';
}
})(view, is_list);
I have also tried 2 view rules, one that is basic and sets the view, and another advanced with the script above without the else part. This method gets rid of the option to select views for all users including admin.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2022 12:19 PM
Hello @Community Alums ,
Check with the user who is not admin and he not part of that group.
It might be a case where one of the condition is getting satisfied
Mark my answer correct if this helps you
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2022 12:22 PM
This looked correct to me, and I tried a bunch of other ways to get the script to workj as expected to no avail. I then found the KB below. It looks like this is a known issue and will NOT be fixed 😞
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0719228
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2022 12:23 PM
IT does look like you can do a custom solution using a client script. You can see that in the workaround at the bottom of the KB.