When there is a UI policy for setting a field as mandatory, the field is highlighted with a red border during submit even though the mandatory condition is no longer applicable. If the policy condition matches, then the fields are mandatory and everything is fine. If the condition does not match during form submit, the non-mandatory fields are still showing as highlighted with a red border.
Steps to Reproduce
- Create two UI policies that set a field mandatory:
- create a UI policy with condition state=3^EQ (Pending Change) and add action to set Description field to mandatory
- create a UI policy without any condition and add action to set KB0547253 field to mandatory
- Navigate to problem.do.
- Set the State field to Pending Change.
Now there are two different mandatory fields.
- Set the State field to something else (for example, Open).
- Click Submit.
See the red border on the Description field with message that only the Short description is mandatory.
As a workaround, add the following styling code that reverts the border color to the original grey in the affected UI Policy condition:
field.style.borderColor = 'rgb(189,192,196)';
Related Problem: PRB639495