hideRelatedList should I use "REL:[sys_id]" or name as the argument and does order of hiding matter?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2023 12:09 PM
So, I found some guidance out there indicating this was the proper syntax for hiding a related list.
//Hide Related Lists that we don't need
g_form.hideRelatedList("REL:48d5301981cf21101304af564a4f7043");
g_form.hideRelatedList("REL:48d5301981cf21101304af564a4f7055");
After running the above nothing was hidden. So, I did this instead and it worked:
//Hide Related lists that we don't need
g_form.hideRelatedList("change_request.parent");
g_form.hideRelatedList("change_task.parent");
One very important thing I also learned in playing with this is if you hide multiple related lists, it seems you must order them as they appear left to right in the tabs or else the first one will hide and the ones after that don't won't hide. So, in the example above, if I ordered these two lines differently one would hide and the other wouldn't.
Hopefully, this ordering and using the name instead of the REL:sys_id helps someone else.
- 454 Views

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2023 08:36 PM - edited 11-21-2023 08:38 PM
Hi @Brian Whyte ,
1)If a related list created through relationship
use g_form.hideRelatedList("REL:48d5301981cf21101304af564a4f7043");
2)If its a related list
use g_form.hideRelatedList("name of the related list");
Related list:
Relationships:
Sometime both wouldn't work since name of the related list has been changed through list control
use:g_form.hideRelatedList("name of the list control");
And Oder doesn't matter here........
Hope this helps
Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025