- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2022 06:29 AM
There is a requirement where when state is in New, I want to hide a particular related list
Solved! Go to Solution.
- Labels:
-
Change Management
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2022 06:31 AM
Hello,
Please write the following code in the client script, I have written on OnLoad type
You can write based on your requirement
function onLoad() {
//Type appropriate comment here, and begin script below
if(g_form.getValue('state') == 1)
{
g_form.hideRelatedList('related list name');
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2022 06:31 AM
Hi,
something like this in onLoad client script
function onLoad(){
if(g_form.getValue('state') == 'new'){
g_form.hideRelatedList('task_ci');
}
}
Hiding Related Lists and Embedded Lists
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2022 06:48 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2022 08:39 AM
Hi,
Did you mistakenly marked other response as correct?
The sample code was already shared in my 1st response. you were supposed to enhance it as per your requirement.
Would you mind marking my response as correct as it was the 1st correct response to your question?
regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2022 06:31 AM
Hello,
Please write the following code in the client script, I have written on OnLoad type
You can write based on your requirement
function onLoad() {
//Type appropriate comment here, and begin script below
if(g_form.getValue('state') == 1)
{
g_form.hideRelatedList('related list name');
}
}