Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Need to hide "Add / Edit / Remove" buttons from Approvers related list in SC Task

FemyM
Tera Contributor

I have a requirement to hide the Add, Edit, and Remove buttons from the Approvers related list (sysapproval_approver) on an SC Task after a particular task is closed complete.

 

I created a Client Script (onLoad) on the sc_task table using:

 

 
g_form.setRelatedListShowAdd('sysapproval_approver', false); g_form.setRelatedListShowActions('sysapproval_approver', false);

But the buttons are not hiding.

I also tried placing the script inside a UI Policy with no success.

Is there a reliable way to hide the Add / Edit / Remove related list buttons for the Approvers list?

3 REPLIES 3

TariqueWasim
Tera Contributor

You can do it through List Control to Omit New/Edit Button

OlaN
Tera Sage
Tera Sage

Hi,

The buttons are there as long as you have access to create/modify/delete records in that table.

You can hide the related list altogether with an UI policy and UI policy related list action if that's what you're after.

 

Otherwise you'll need to configure the list control of the related list, and omit the buttons (and probably set a condition for when the button should be omitted.

 

configure-list-control.png

Ankur Bawiskar
Tera Patron
Tera Patron

@FemyM 

script you shared won't work in workspace

OOTB I couldn't find New, Add, Edit button on Approvers Related list on sc task form

seems somebody added that with some custom solution

AnkurBawiskar_0-1764838306529.png

 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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