- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-19-2019 03:50 AM
How to hide a related list that is created from a Relationship.
I have tried using the UI Policy,but no luck.
Please help.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-19-2019 05:00 AM
Hi,
Go through the below link,
https://www.servicenowguru.com/scripting/client-scripts-scripting/hiding-related-lists-embedded-lists/
Mark correct/helpful based on impact.
Thanks,
Dhananjay.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-19-2019 04:16 AM
Hi,
You need to use a client script to do this, specifically hideRelatedList
Take a look at https://developer.servicenow.com/app.do#!/api_doc?v=newyork&id=r_GlideFormHideRelatedLists for the documentation. Note that for a relationship you need to pass the sys_id of the relationship, not its name as you would for a table.
Kind regards,
Simon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-19-2019 04:57 AM
Create UI Policy for the form with condition as field 'Action' is No.
To hide the related list Add the below code in the Execute if True script section.
g_form.hideRelatedList('related_list_table_name');
To show the related list Add the below code in the Execute if False script section.
g_form.showRelatedList('related_list_table_name');
Note: Get the related_list_table_name from thee list control of the related list. Right click related list header > Personalize/Configure List Control. Copy the value from the field 'Related list'

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-19-2019 05:00 AM
Hi,
Go through the below link,
https://www.servicenowguru.com/scripting/client-scripts-scripting/hiding-related-lists-embedded-lists/
Mark correct/helpful based on impact.
Thanks,
Dhananjay.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2022 01:31 PM
To hide a related list that was created through a relationship use:
g_form.hideRelatedList('REL:<sys_id of the relationship>');
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0758509