Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2023 06:37 AM
1 ACCEPTED SOLUTION
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2023 12:54 AM
Hi @SAS21,
Try this updated view rule scripts:
(function overrideView(view, is_list) {
var role = gs.hasRole('x_sb_nw_bu_analyst');
if (is_list && role) { // if it's a list and has required role
answer = "vendor"; // set the new view to answer
} else // if it's not a list, in other words, on a form
answer = ""; // "" is for default view
})(view, is_list);
For your reference: KB0723494
If my response helps to solve your issue. Kindly mark it as helpful & correct. It will be helpful for future readers.
Thanks,
Sagar Pagar
The world works with ServiceNow
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2023 12:54 AM
Hi @SAS21,
Try this updated view rule scripts:
(function overrideView(view, is_list) {
var role = gs.hasRole('x_sb_nw_bu_analyst');
if (is_list && role) { // if it's a list and has required role
answer = "vendor"; // set the new view to answer
} else // if it's not a list, in other words, on a form
answer = ""; // "" is for default view
})(view, is_list);
For your reference: KB0723494
If my response helps to solve your issue. Kindly mark it as helpful & correct. It will be helpful for future readers.
Thanks,
Sagar Pagar
The world works with ServiceNow