Hide/Show related list tab

SnowUserDev
Tera Contributor

Hello Community,

 

How can I hide/show a particular related list for a certain group/user

2 ACCEPTED SOLUTIONS

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @SnowUserDev 

 

https://www.servicenow.com/community/developer-forum/how-to-hide-a-related-lists-based-on-certain-co...

 

You create UI policy to show and hide the related list based on condition

Go through the below link :-

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

Sample Example :

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'

 

credits : @Community Alums 

 

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0758509

 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

View solution in original post

2 REPLIES 2

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @SnowUserDev 

 

https://www.servicenow.com/community/developer-forum/how-to-hide-a-related-lists-based-on-certain-co...

 

You create UI policy to show and hide the related list based on condition

Go through the below link :-

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

Sample Example :

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'

 

credits : @Community Alums 

 

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0758509

 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************