- 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 08:59 AM
Instead of giving sys_id, give the name of related List.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-27-2016 09:13 AM
so something like this I tried, didn't work
function onCondition() {
g_form.hideRelatedList('Total Cost');
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-27-2016 09:23 AM
check that was Exact name or not. Check using system ui --> related lists
actually that Ui policy wanna work, but why it should failed? please provide screen shot for that
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-27-2016 09:36 AM
Maybe I have this wrong - I created a 'Relationship' that queries a 'Total Cost' table for specific fields and puts it on a 'Finance' table. I used 'Form Layout' to put this on the 'Finance Table' form. It is still considered a Related List right?