EDIT Button is Missing on group form

swethaa
Kilo Contributor

Hi All,

We have custom application, there are 5 groups : In group form , there is two fields with the name Manager and Backup Manager. 

Issue is : we have assigned two users for both Manager and Backup Manager to the same groups and same roles but the user who is assigned to Backup Manager ( not able to see " EDIT " button when the user open group form under related list.

find_real_file.png

10 REPLIES 10

Hi there,

Where is the backup manager defined? On which table, which field? That makes it easier to understand what to add as a condition.

Also, can you confirm that the backup manager can write on the table concerned? Again as I mentioned, it looks like the record is read-only. My guess is that making the edit button available might not be enough.

If my answer helped you in any way, please then mark it as helpfull.

Kind regards,
Mark

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Vikrant Kumar
Giga Contributor

hi,

try using below code:

var answer = true; //Hide the 'Edit' button by default
if (gs.hasRole('user_admin') ||
parent.manager == gs.getUserID() || parent.backup_manager == gs.getUserID() || parent.u_wdpr_parent.manager.sys_id.toString() === gs.getUserID() || gs.getUser().isMemberOf(parent.u_wdpr_parent) || (parent.u_wdpr_self_managed && gs.getUser().isMemberOf(parent.name)) ) {
answer = false; //Show the 'Edit' button if user has 'user_admin' role or is group manager
}

 

replace backup_manager field name with your actual field name of Backup Manager.

 

Thanks

Hi ,

 

I have tried the above code but it is showing edit button who is manager, backup manager for all the groups as they have written script in sys user group table.

 

But now if i want to show edit button only to the manager, backup manager only for a particular scoped application. Is it possible?

Can you be more specific like what application/group you want to filter so that i can provide you desired filter? 

The SN Nerd
Giga Sage
Giga Sage

To modify a Many2Many table (such as Group Members) table in OOTB ServiceNow, you must have Create rights on that table.
The condition is below.

(new GlideRecord(current.getTableName())).canCreate() && RP.isManyToMany() && !RP.getListControl().isOmitEditButton()

Ensure there is a Create ACL on the sys_user_grmember table for the "Backup Manager" role and the Edit button will show for all groups.


ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022