Multiple UI Policies on the same field

lisa_ong
Kilo Contributor

Hi everyone,

 

Couldn't find much detail around this on the wiki or specifics that we can relate/use in the community, so I'll ask the question.

 

Is it possible to have more than one UI policy run on the same field?

 

For example, we have a field called Asset Tag. We have two policies running on it, each with a slightly different condition to the other.

 

UI Policy 1:

Company = X

OR Company = Y

AND Device class = ABC

AND Device ownership = Corporate (this is the differing condition)

AND Asset status = one of these: 1,2,3,4 etc

Make Asset tag field visible and mandatory

Run order: 100

 

UI Policy 2:

Company = A

OR Company = B

AND Device class = ABC

AND Asset status = one of these: 1,2,3,4 etc

Make Asset tag field visible and mandatory

Run order: 101

 

Originally the run order on both was 100, but because of the conflict error that appears, we have changed it to 100 and 101. The problem now is that Policy 1 works when you re-open the record, but Policy 2 does not work.

1 ACCEPTED SOLUTION

Bhavesh Jain1
Giga Guru

Hi,



I will share my experience. For cases where there was no clash of UI policies, I made the 'Reverse If 'False -->true.


But when there was a need to create multiple UI policies, I made this field set to False so opposite actions does not get executed.



Try making the reverse if false as False if you dont need it.


View solution in original post

7 REPLIES 7

rushputin
Mega Expert

There should be nothing keeping you from having multiple UI Policies impacting the same field (I'm certaianly doing it), though a UI Policy applied at an earlier order might be countermanded or superseded by a subsequently applied UI Policy.



Your issues are probably coming from some aspect of your conditions or a Reverse if False.


Bhavesh Jain1
Giga Guru

Hi,



I will share my experience. For cases where there was no clash of UI policies, I made the 'Reverse If 'False -->true.


But when there was a need to create multiple UI policies, I made this field set to False so opposite actions does not get executed.



Try making the reverse if false as False if you dont need it.


OMG  your answer just saved my weekend 😄 Thank you

tltoulson
Kilo Sage

Hi Lisa,



With UI Policies it is important to isolate the behaviors to prevent collisions in the scripts (2 or more scripts trying to act on the same field at the same time).   Bhavesh gives a great suggestion on how to accomplish this by removing the 'Reverse If False'.



Another option that has been my preferred route in the past is to change your conditions such that a field is controlled by a single UI Policy.   This often means fewer fields to a given policy but it also makes it easier to figure out why a field is being affected.   On any given policy, you would mark all conditions that would result in the field being displayed and mark it as reverse if false.