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

Community Alums
Not applicable

Hi Jaspal,

Yes its a custom one and i have used the same in my code. So like this i can code rite?

if (g_form.getValue('u_requesttype') == 'test') {
g_form.hideRelatedList('REL:90bb91381bc06c90a28aec223e4bcb7e');
} else {
g_form.hideRelatedList('REL:90bb91381bc06c90a28aec223e4bcb7e');
}