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?

11 REPLIES 11

@FemyM 

I already informed you can add logic to control the visibility in Script Condition field

did you that approach?

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

SinghShailendra
Tera Contributor

Hi @FemyM 
You can use  List View Rule
Navigate:  sys_ui_list_view_rule.list  → New

Table: sysapproval_approver (Approvers table)
View: Default view (or workspace view)
Conditions: request_item.sc_task.state!=3^ORrequest_item.sc_task.stateISEMPTY
Type: list_view
Active: true

If my response helped, please mark it as correct