omit edit button on group table level
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2024 04:59 AM
Hi All,
we want that only the Group owner can see and use the "edit" button on the related list "Group Members". Therefore we edited the List control and added following omit edit button script.
But some reasons it's not working, can anyone please help us here.
Advance thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2024 08:15 AM
try this
var currentUser = gs.getUserID();
var groupManager = parent.group.manager.toString();
var isAdmin = gs.hasRole('admin');
if(currentUser == groupManager || isAdmin)
answer = false;
else
answer = true;
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2024 08:37 AM
Hi Ankur,
Thanks for the response.
Tried your script but no luck, still the group's managers are not seeing the Edit option.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2024 07:47 PM
what came in log for parent.group.manager?
Are you sure the group has manager populated?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2024 11:26 PM
Hi Ankur,
We have replaced parent with current then we're seeing the manager sys_id in logs and it's working fine .
But the Edit is option is showing only if the users are available in groups.
I mean let assume that if there is no users in group and if same group's manager opened the group to add the users , In this scenario the Edit option is not showing.
Advance thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2024 11:30 PM
is the group manager a group member also?
Also is the group having manager field populated?
Script looks good to me
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader