- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-11-2022 05:15 AM
I want to show the UI Action Related list for limited groups only and for Admins as well.
I have written the below code in 'omit new button'.
!gs.getUser().isMemberOf('assignment_group') || !gs.getUser().isMemberOf('assignment_group') || !gs.getUser().isMemberOf('assignment_group') || !gs.getUser().isMemberOf('assignment_group') && checked with || as well !(gs.hasRole('admin'));
the above code is working for mentioned groups but not for Admins, Admins are not able to see the New button.
My Requirement is Admin and the mentioned group members only should see the New button as per the screenshots.
Solved! Go to Solution.
- Labels:
-
Request Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-11-2022 08:14 AM
With omit new condition, "true" result hides the button, "false" shows the button. with your original code with the ! in place, you need to switch to "&&" instead of "||". This should result in the right results.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-11-2022 05:29 AM
Hi Harish,
In that case I guess you need to remove not from your condition:
gs.getUser().isMemberOf('assignment_group') || gs.getUser().isMemberOf('assignment_group') || gs.getUser().isMemberOf('assignment_group') || gs.getUser().isMemberOf('assignment_group') || (gs.hasRole('admin'));
Please mark this as correct and helpful if it resolved the query or lead you in right direction.
Thanks,
Mohit Kaushik
Community Rising Star 2022
Mohit Kaushik
ServiceNow MVP (2023-2025)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-11-2022 06:44 AM
Hi Mohit,
Tried but not working.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-11-2022 08:14 AM
With omit new condition, "true" result hides the button, "false" shows the button. with your original code with the ! in place, you need to switch to "&&" instead of "||". This should result in the right results.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-16-2022 02:39 AM
thank you Kristen, working fine now