I want to create custom UI action on Related list

Sumit Singh
Tera Expert

I want to create two different custom UI actions on two related lists which are having a relationship with the same table.
The issue I am getting is both the UI actions are visible on both the related lists.
I found this solution on the community ("RP.getListControl().getControlID()" and validate in script include) but it is not working for me.
Please help me with this.

 

cm.png

1 ACCEPTED SOLUTION

Voona Rohila
Kilo Patron
Kilo Patron

Hi @Sumit Singh 

Try this in ui action condition

 

"Label name"equals(RP.getListControl().getLabel()) //modify label name with the related list label -  Custom Problem

 

refer below link 

https://www.servicenow.com/community/now-platform-forum/do-anyone-know-rp-getlistcontrol-getlabel/m-...

 


Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP

View solution in original post

4 REPLIES 4

Voona Rohila
Kilo Patron
Kilo Patron

Hi @Sumit Singh 

Try this in ui action condition

 

"Label name"equals(RP.getListControl().getLabel()) //modify label name with the related list label -  Custom Problem

 

refer below link 

https://www.servicenow.com/community/now-platform-forum/do-anyone-know-rp-getlistcontrol-getlabel/m-...

 


Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP

Hi @Voona Rohila 
I am having doubt..
This method is perfectly working in Global scope but when I am using this in a custom application It is not working.

It should work for scoped app too

Refer below link

https://docs.servicenow.com/bundle/tokyo-application-development/page/app-store/dev_portal/API_refer...

 

Also try using getTitle()

https://www.servicenow.com/community/developer-forum/get-the-name-of-a-related-list-in-a-list-choice...


Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP

It worked for me in scoped applications, but I wish there was a way to use a sys_id instead of label. I wrote a script include to meet my requirements.