- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-27-2016 08:46 AM
Hi Experts,
I have a related list I'm wanting to hide through UI Policy when state 'is one of' draft, pending, WIP. I've been able to do this before via getting the related list value from List Control and putting it directly in the UI Policy Script. I've set my 'when to run' conditions in place and I have the 'onLoad' checked, and 'reverse if possible' checked. Not sure why this isn't working.
function onCondition() {
g_form.hideRelatedList('REL:7bb4a2e0134e6e001b8f3598d144b03b');
}
function onCondition() {
g_form.showRelatedList('REL:7bb4a2e0134e6e001b8f3598d144b03b');
}
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-27-2016 09:54 AM
That would be an embedded list James. The function you are using wouldn't work for that. Refer to this link: Hiding Related Lists and Embedded Lists - ServiceNow Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-27-2016 09:50 AM
sorry, i did not get you point? could you please tell me more
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-27-2016 09:54 AM
That would be an embedded list James. The function you are using wouldn't work for that. Refer to this link: Hiding Related Lists and Embedded Lists - ServiceNow Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-27-2016 10:09 AM
Thank! Now that we figured that out and it works, the team wants to take another approach since we have a lot of embedded lists to hide, is it possible to do it through onChange client script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-27-2016 09:58 AM
Related lists are configured using configure - related lists. The lists you bring to form using Form Layout would be embedded lists. They are essentially the same but in the simplest terms, related lists have more control options, and embedded lists can be placed anywhere on the form within a section.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-05-2019 05:20 AM
If nothing works, then try below code in UI Policy
function onCondition() {
addLoadEvent(hideIncidents);
function hideIncidents(){
g_form.hideRelatedList('incident'); // Table name of related list
}
}