- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2022 05:42 AM
Hello all,
How do I hide related list using client script, in condition? If you please share your ideas that would be greatly appreciated?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2022 05:46 AM
Hi Ramesh,
I would prefer to use a UI policy to hide a related list. Put you relevant condition and in the UI Policy Related List Action add your related list which needs to be hidden.
Regards,
Deepankar Mathur

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2022 05:46 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2022 05:53 AM
Hello Deepankar,
I really appreciate it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2022 05:49 AM
Hi Ramesh,
You can try the below script:
g_form.hideRelatedList("related list name");
g_form.hideRelatedLists(); //use this if you want to hide all
Thanks,
Murthy
Murthy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2022 05:49 AM
Hi Ramesh,
You can use below code in client script
You can use g_form.hideRelatedList('name of the related list') method in UI policy script in true block
function onLoad(){
if(g_form.getValue('<name of field>') == ''){
g_form.hideRelatedList('name of the related list');
}
}
Please let me know if you need any details
Regards,
Valmik