Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

How to get the name/ ID of the specific Related list tab using script in UI Action ?

tejaswini3p
Tera Contributor

The related list contains multiple tabs and buttons, and the same button is used across different tabs. For example, on the Change Request table, there are related lists such as "Incidents Caused By Change" and "Incidents Fixed By Change".

I need to identify which related list tab is currently active, or from which tab the "New" button was clicked. Since the same button is used on multiple tabs, I want to execute a specific block of code based on the active related list tab.

2 REPLIES 2

Ankur Bawiskar
Tera Patron

@tejaswini3p 

what's your actual business requirement here?

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

tejaswini3p
Tera Contributor

The Change Request record has related lists displayed as tabs, and a banner "New" button is available for those related lists.

When a user clicks the "New" button, I need to determine which related list tab is currently active. At the moment, I am unable to retrieve the active tab name.

Once I can identify the active tab, I will add a specific block of code that executes only when the active related list is "Incidents Caused By Change". The same "New" button is used across multiple related list tabs, so the logic needs to be based on the selected tab.