Is there another way to get the annotations and fields under the annotations to hide or show without using the ui policies?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-20-2018 12:23 PM
Hello there,
I have been working on hiding or showing certain amount of annotations and the fields under them but is not working properly consistently. Is there a client script available to do that? Here is what I have been doing.
On UI Policy to Hide annotation:
Condition if number of shipping =1
onLoad clicked
execute script if true
document.getElementById("anno1").parentNode.style.display = " ";
execute if false
document.getElementById("anno1").parentNode.style.display = " none";
Will greatly appreciate the help.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-20-2018 01:13 PM
Can you post a screenshot of what you're trying to hide exactly? I'm not sure what you mean by fields under an annotation because I don't think the system groups fields under an annotation as far as I know.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2018 06:57 AM
hey Mark,
Thanks for the response. I understand that the fields are not grouped under the annotations. What I was trying to explain is that when I try to hide the fields in a UI Policy through UI Actions when also having a script to hide the annotations it doesn't work for me and that is why I asked if there is another way to have both done at the same time using an onChange client script with conditional to when I want them to show or hide them.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2018 07:12 AM
Can you confirm that the show/hide of the annotation works fine if you just do that on its own? You could simplify the script a bit by using PrototypeJS like this, but I don't think that's going to make a difference.
$("anno1").parentNode.show();
$("anno1").parentNode.hide();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-20-2018 01:24 PM
UI Policy scripts are basically client scripts so the DOM statements you are using in the UI Policy will also work in a client script:
document.getElementById("anno1").parentNode.style.display = " ";
document.getElementById("anno1").parentNode.style.display = " none";