
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-02-2020 11:19 PM
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-02-2020 11:54 PM
try to configure the list control for that related list
Then pick the name from there
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-03-2020 12:22 AM
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');
}