- 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-02-2020 11:45 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-03-2020 12:02 AM
Hi Shivani,
I am getting sys_id kind of thing. Not names.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-03-2020 12:27 AM
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');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-02-2020 11:54 PM