Help required with UI policy based on multiple conditions

jas101
Tera Expert

Hi guys, hope someone can help as this is driving me a little made when I thought it would be straight forward - hopefully it is and I've just got fog brain from staring at it for a little long!

On our change form we have a 'Downtime?' None/Yes/No field. If the user answers 'Yes', 2 other fields appear asking for 'Downtime details' and 'Downtime duration'.

It is obviously easy to make these other 2 fields appear on 'Yes' only with a UI policy. However we want to make all these fields mandatory only if State is past 'New' (i.e  State not 'New') and this is what I'm struggling with. The best I have got so far is using 2 UI policies that mandatory behaviour works as expected but if the State is not 'New' e.g. 'Assess' the other 2 fields still show if the user changes 'Downtime?' back to N. I think the 'Reverse is true' may be causing issues.

What is the best way to handle this request please? Thank-you.

5 REPLIES 5

Jaspal Singh
Mega Patron
Mega Patron

Hi,

 

Create 2 UI policies

1. With State is New & choice value Yes then in UI policy action make all necessary fields visible as True.

2. With State is Not New & Choice value Yes then in UI policy action make all necessary fields visible & mandatory as True.

 

Thanks,

Jaspal Singh

 

Hit Helpful or Correct on the impact of response.

Allen Andreas
Administrator
Administrator

Hi,

It's "Reverse if false", and that is actually a good thing to have checked. That means if for some reason that field DOESN'T meet that criteria, where it previously did before, it'll go back to default and not show them.

Are you able to screenshot both of your UI polices so we can see what you have?


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Hi, thanks - yes I'm always reluctant about 'unchecking' Reverse if false tbh. They were actually as Jaspal has suggested above i.e. 

1. With State is New & choice value Yes then in UI policy action make all necessary fields visible as True.

2. With State is Not New & Choice value Yes then in UI policy action make all necessary fields visible & mandatory as True.

bbf3562
Kilo Guru

There are 2 ways to do it (I haven't test it),

  1. You can set up 2 UI policies. 1 policy with condition if state is new then make the 2 fields appear with mandatory and other policy with condition if state is any others beside new can make the 2 fields appear without mandatory.
  2. I am not sure if this is catalog item, if it does then keep 1 UI policy that only make 2 fields appear if selected yes and you can use catalog client scripts and use onChange as type that focus on downtime field then use IF conditions to see if downtime is selected Yes and then create another IF condition inside to check if the state is new or not. If it new then make 2 fields a mandatory, else, make it non-mandatory.