Remove "Add" UI Action from the custom related list

akshay jadhav
Tera Contributor

Hello All,

We created a custom related list for the incident table, and the OOB "Add" UI Action appeared here. We need to hide this from this related list only, however there is no option to omit it, and we tried adding code   to the UI Action condition but it did not work. Does anyone have any ideas?

 

Code we tried - !current.related_list.is("sys_id_of_related_list")&&

 

akshayjadhav_0-1728047881152.png

akshayjadhav_1-1728048179786.png

 

akshayjadhav_2-1728048203551.png

 

 

9 REPLIES 9

 

 omit edit button get disables here as we can see in the screenshot

AkshayJadhav1_1-1728058489217.png

 

Brad Bowman
Kilo Patron
Kilo Patron

The Omit edit button is grayed out as this is not valid/possible on custom related lists.  You are already omitting the New button, which is why that one is not shown.  On the Add UI Action you have pictured, all you need in the condition is to not show it on related lists, so

!RP.isRelatedList()

Add this to the beginning or end of whatever else might be there, joining to the other conditions with &&, or if this is already there without the !, just add the !

Hello Brad,

 

Thanks for reply, If i implement your solution it will hide in all related lists. However we want to hide it for one single custom related list.

I tried this code 

 !current.related_list.is("sys_id_of_related_list")

 

But didn't worked 

'current' in this case will refer to the queries_from table, which is change_request, while the related_list field is on the sys_ui_list_control table.  I came up with this, which seems to work

RP.isRelatedList()&&RP.getListControl().getControlID()!='996e692d53099650324c17c0a0490ebb'

Where that last bit is the sys_id of the List Control record for this Related List - so right-click, Configure, List Control, then right-click in the gray header and Copy sys_id.

 

This worked, Thank you Brad