The CreatorCon Call for Content is officially open! Get started here.

Can't hide related list

TzachB
Giga Contributor

Hello everyone,

I'm try to hide all related lists on my form  but it's doesn't work for me.

I tried g_form.hideRelatedListS(); all the related lists are disappeared except one.

I tried to hide the specific list but it's still there. (g_form.hideRelatedList('REL:7bb4a2e0134e6e001b8f3598d144b03b');)

 

Thank you,

Tzach.

20 REPLIES 20

AbhishekGardade
Giga Sage

Hello Tzach,

To hide the related list Add the below code in the Execute if True script section.

g_form.hideRelatedList('related_list_table_name'); // DONT PASS SYS_ID

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'

OR Check out this link:,

https://www.servicenowguru.com/scripting/client-scripts-scripting/hiding-related-lists-embedded-list...

Please mark as Correct Answer/Helpful, if applicable.
Thanks!
Abhishek Gardade

Thank you,
Abhishek Gardade

If you are trying to hide it from mobile view then it will not work. Please check out this HI ticket.

https://hi.service-now.com/kb_view.do?sysparm_article=KB0551091

Thanks

Thank you,
Abhishek Gardade

Also check out this docs files, ServiceNow added a option to  hide related list with the help of UI POLICY.

https://developer.servicenow.com/app.do#!/training/article/app_store_learnv2_scripting_madrid_client...

If you are trying to hide it from mobile view then it will not work. Please check out this HI ticket.

https://hi.service-now.com/kb_view.do?sysparm_article=KB0551091

Thanks

Thanks,
Abhishek

Thank you,
Abhishek Gardade

Also check out this docs files, ServiceNow added a option to  hide related list with the help of UI POLICY FROM LONDON RELEASE.

https://developer.servicenow.com/app.do#!/training/article/app_store_learnv2_scripting_madrid_client...

If you are trying to hide it from mobile view then it will not work. Please check out this HI ticket.

https://hi.service-now.com/kb_view.do?sysparm_article=KB0551091

Thanks

Thanks,
Abhishek

Thank you,
Abhishek Gardade