Hiding fields using UI Policy

ceraulo
Mega Guru

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.
find_real_file.png

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!

1 ACCEPTED SOLUTION

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!

View solution in original post

7 REPLIES 7

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!

Hi,

Let me know if you need further assistance, but I believe I've covered everything here?

If you don't mind, please also mark my reply above (that has the Correct answer) as Correct as well.

Thanks!

Sateesh Kumar 2
Kilo Guru

Hello,

Here you have two scenarios when A is empty and when A changes from one value to another.

UI policy condition can handle the first scenario that is when A is empty but there is no condition to check if the value of A had changed.

So for second scenario, you have to write a onchange client script on field A to clear the value of B and C, you can use the same script as mentioned by Allen in your client script.

 

Regards,

Sateesh Kumar Devadoss.