View Rules - Default View Setup for a Specific Role
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-30-2022 08:38 AM
I'd like to setup a view rule for the default view for just one particular role.
If the user has X role they will get the default view.
Is there an easy way to do this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-30-2022 08:45 AM
You can do this with a view rule. You can use an advanced script to look at user role.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-30-2022 08:46 AM
Something like:
if (gs.hasRole('RoleA')) { answer = "ViewA";
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-30-2022 08:54 AM
I am not sure what I am doing wrong. It's not working.
I am not sure if it's the dot in the role name or do I need an underscore in the view? I've tried both.
Role Name: x_scope.manager (the role name contains a . should it be a . or _?)
View: Default View
(function overrideView(view, is_list) {
// Add your code here
if (gs.hasRole('x_scope.manager')){
answer = "default view";}
})(view, is_list);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-30-2022 09:02 AM
I put this in my PDI using the same script and role and it works without issue. Are you sure the person you are impersinating has the role?