How to make the edit button on a related list appear for certain users

matthew_hughes
Kilo Sage

On the below form, the 'Edit' button appears within the 'Knowledge' related list:

find_real_file.png

 

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?

1 ACCEPTED SOLUTION

matthew_hughes
Kilo Sage

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.

View solution in original post

15 REPLIES 15

Yousaf
Giga Sage

Hi,

You can assign create a role for these groups and give that role in UI Action OR

You can set the condition something like gs.getUser().isMemeberOf('your group name') and you can use and/Or condition to add more groups.

 

 

Mark Correct or Helpful if it helps.


***Mark Correct or Helpful if it helps.***

Hi,

So there's nothing that can be done that makes the 'Edit' button visible to the user either the 'Architecture lead(owner)' or 'Domain Steward' of the current record?

Community Alums
Not applicable

Hello,

This can be achieved by  List Control.

  • Open the form containing the related list to update. In the example, the Incident form is used.
  • Right-click the header bar of the related list and select Personalize > List Control. In the example, the Task SLAs related list is used.
  • Select specific roles that can use the buttons. Click the lock icon next to Edit roles and move roles from the Available column to the Selected column.
  • Click Update.
  • On the parent form, check that the Edit buttons appear in the related list as per role.

 

find_real_file.png

 

 

If this not works, check if any ACL running on this.

 

Thanks
Akshay Kangankar
Please Mark Correct/helpful, if applicable,

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

you can configure the list control on that related list and add Script inside the Omit Edit button script

I assume you are referring to logged in user's title

answer = checkCondition();

function checkCondition(){

	var title = gs.getUser().getRecord().getValue('title');

	if(title == 'Domain Steward' || title == 'Architecture lead(owner)' || gs.getUser().isMemberOf('Group ABC'))
		return false; // show it
	else
		return true; // omit it
}

find_real_file.png

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader