How to find a related list back end name?

Community Alums
Not applicable

Hi All,

I need to hide a related list based on field1 value. My related list name "Test Requests", i have written the below code. It is not working.

function onLoad() {
//Type appropriate comment here, and begin script below
if (g_form.getValue('u_request') == 'test') {
g_form.hideRelatedList('test_requests');
} else {
g_form.hideRelatedList('test_requests');
}
}

 

Regards,

Sirraj

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Sirraj 

try to configure the list control for that related list

Then pick the name from there

find_real_file.png

find_real_file.png

Regards
Ankur

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

View solution in original post

10 REPLIES 10

Shivani Singh1
Tera Guru

Hi Sirraj,

You can follow these steps:

1) Search in navigator

find_real_file.png

2) Search by your table and view(if any)

find_real_file.png

3) Open the required record and you will find backend name of related list as in image.

find_real_file.png

 

Please mark helpful if it solves the purpose

Community Alums
Not applicable

Hi Shivani,

I am getting sys_id kind of thing. Not names.

Ok, that means it's a custom related list so it will show sys-id. Modify it to:

Related list name : REL:9d7c170acba7330016e9582df8076d7d

then modify script to

g_form.hideRelatedList('REL:9d7c170acba7330016e9582df8076d7d');

 

 

Ankur Bawiskar
Tera Patron
Tera Patron

@Sirraj 

try to configure the list control for that related list

Then pick the name from there

find_real_file.png

find_real_file.png

Regards
Ankur

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