- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2020 04:59 PM
Hello!
I have 4 fields - A, B, C, D.
On initial load of the form, only A is visible.
Fields B, C, D becomes visible when a value is selected from A which is a reference field.
The requirement is to clear B, C, D of values then hide it when A is updated to empty or another value is selected.
I created a UI Policy that is triggered when A is empty and see photo below.
The above works but only if B, C, D have values. If it has no value, the values are cleared but the fields are still viisble.
Please help!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2020 06:54 AM
Hi,
Well, the solution would be to make them mandatory once field A has a value (using that same UI policy) = setting mandatory > true.
So remove the mandatory checkmark in each of the variables individually (if it's checked now, which I assume it is)...
THEN....when field A has no value, they aren't mandatory anymore thus they will hide...and then my small script above clears the values out of b,c,d.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2020 05:03 PM
Please write an OnChange client script on the field A
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2020 05:18 PM
I also tried that using setDisplay but does not work. It works when using setVisible but it doesn't adjust other fields on the form. There is a big gap betwen Field A and other fields below Field D.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2020 05:27 PM
Hello,
Can you share a screenshot of your UI policy where these fields are set to show if A has a value?
You shouldn't need a second UI Policy to then hide these fields as the first UI Policy will do that for you (if you set those B, C, D fields to Visible = True, then anytime it's NOT true, they will auto-hide for you.
In the script section for the UI policy where they would show, in the "run if false" script section, you could add:
g_form.clearValue('field_b');
g_form.clearValue('field_c');
g_form.clearValue('field_d');
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2020 05:36 AM
I have figured it out. There is no solution because setDisplay only work for fields that are not mandatory. The fields in my catalog item are all mandatory.