- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2022 07:44 AM
On the below form, the 'Edit' button appears within the 'Knowledge' related list:
However, I only want to make the 'Edit' button available for the current record if the user is either the 'Architecture lead(owner)', 'Domain Steward' or a member of a particular group.
What would I need to add to the List Control?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-05-2022 06:10 AM
I've managed to do this by using 'List Control' and applying a script that checks if the current users has the required role and then if they are set in the one of the fields on the form.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-01-2022 12:06 AM
Hi
I tried the following code:
function checkRole() {
if (gs.hasRole('lbg_architecture_domain_admin')) {
return false; // show it
}
else if(gs.hasRole('lbg_architecture_domain_manager')) {
if (parent.u_architecture_domain.owned_by == gs.getUserID() || (parent.u_architecture_domain.managed_by == gs.getUserID())) {
return false; // show it
}
}
else {
return true; // omit it
}
}
checkRole();
However, I think it might be related to the create ACL because the Edit button will appear if I specify a role within the Crete ACL.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-01-2022 12:37 AM
Hi,
edit button also checks if the logged in user satisfies the field level WRITE ACL
i.e. field present on related list table u_architecture_domain is being allowed write Access or not
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-07-2022 07:52 AM
Hi
User should have the "write" access on the related list table to see this "Edit" button because even though i wrote the above script in "Omit Edit condition", users still don't see the "edit" button on the related list.
If they need "write" access on the table but we don't want to give to them this access, is there still any option we can still grant the "edit" button access?
Any help much appreciated.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2022 01:46 AM
Hi Matthew,
I presume there would be limited users who are Domain Steward or Architecture lead(owner), so is it possible to add them to the existing 'Architecture Admin Group' or create a new group and then use this group as a condition in Omit edit condition script?
Example script-
function checkDisplay()
{
if (gs.getuser.isMemberOf(('Architecture Doman Group' || ('New_group_if_you_create'))
{
return false; // this should display Edit button
}
else
return true; //this should not display Edit button.
}
Please mark this answer as helpful/correct based on the impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-05-2022 06:10 AM
I've managed to do this by using 'List Control' and applying a script that checks if the current users has the required role and then if they are set in the one of the fields on the form.