Edit button visible only to specific group

ServiceNow10sun
Giga Guru

Hi All , 

 

I have requirement that the edit button in related list ' Approver' in change form   should be visible to group 'Wrap group' .

 

Please provide the steps to do it . 

is it possible without script include.

sunita10_0-1678944911889.png

 

1 ACCEPTED SOLUTION

Teja11
Giga Guru

Hi @ServiceNow10sun ,

 

right click on any field on the related list - > configure -> list control

 

in that write this script "!gs.getUser().isMemberOf('Wrap Group');" in the omit edit button script

 

Teja11_0-1678945929830.png

 

 

 

Regards,

Teja

 

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.

View solution in original post

9 REPLIES 9

Teja11
Giga Guru

Hi @ServiceNow10sun ,

 

right click on any field on the related list - > configure -> list control

 

in that write this script "!gs.getUser().isMemberOf('Wrap Group');" in the omit edit button script

 

Teja11_0-1678945929830.png

 

 

 

Regards,

Teja

 

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.

Thank you so much it worked . Just a question if i have multiple groups instead of one group what will be best way to achieve that sysproperty  or similar way we have to write multiple lines for each group. 

If you have other groups use this

!gs.getUser().isMemberOf('Wrap Group') && !gs.getUser().isMemberOf('OtherGroup')

or if there are multiple number of groups, you can store them in  a system property

   and check if the user is part of any of those groups

Hi @Teja11 ,

@Ratnakar7 

I have requirement like if group is "PFA", , only user is john is allowed to add members to "PFA" group by using edit button on sys_user_group table under related list , no one is allowed to edit member of that group.I have added screenshot , please refer for more details.

anitha0887_0-1723067789328.png