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

Show/Hide Related List When the Assignment group Selected is CAB Approval

Subhashini C
Tera Contributor
 
4 REPLIES 4

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Subhashini C 

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

 

https://www.servicenow.com/community/csm-forum/how-to-hide-related-list-based-on-condition/m-p/40772...

*************************************************************************************************************
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]

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

Dnyaneshwaree
Mega Sage

Hello @Subhashini C ,

Create onload client script on required table and use below code(update field names as per your req):

 

function onLoad() {
    if (g_form.getValue("assignment_group") == "sysid of that assignment group") {
		g_form.hideRelatedList("your field name that needs to hide");
    }
}

 

If you want to use different way like onchange client script, workflow, flow, BR, etc. then please elaborate it more.

Please accept my solution if it works for you and thumps up to mark it as helpful.

Thank you!!
 
 

Please accept my solution if it works for you and thumps up to mark it as helpful.
Thank you!!

Dnyaneshwaree Satpute
Tera Guru

Ankur Bawiskar
Tera Patron
Tera Patron

@Subhashini C 

you can use onChange client script and show/hide the related list.

ensure you use the correct syntax since the syntax might vary for defined related list and normal related list

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Harish Bainsla
Kilo Patron
Kilo Patron

Hi @Subhashini C  try below code 

function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue === '') {
return;
}

var assignmentGroup = g_form.getValue('assignment_group');

if (assignmentGroup =='b85d44954a3623120004689b2d5dd60a') {
g_form.hideRelatedList('related list name');
}
}