Setting a variable to not-mandatory and hidden using a UI policy does not work on the variable editor on a form.
Steps to Reproduce
Create a new catalog item.
Create a multiple choice variable with two choices (Choice 1 and Choice 2). Under Type Specifications check Do not select the first choice.
Create two multi-line variables (V1 and V2) and set them to mandatory through the variable checkbox.
Create two UI policies.
- One applying to the multiple choice variable created when Choice 1 is selected, with a policy action setting V1 visible and mandatory to True, and Reverse if False checked
- One applying to the multiple choice variable created when Choice 2 is selected, with a policy action setting V2 visible and mandatory to True, and Reverse if False checked.
Click Try it.
Check choice 1.
It should show variable V1 and be mandatory.
Check choice 2.
It will hide the V1 variable and make it not-mandatory, and show the V2 variable that was hidden.
Type something on V2 variable and select Order Now.
Note that you can order the item because the other variable is hidden and not mandatory.
Go to the RITM and make sure that the variable editor shows up in the form.
Test the UI Policy in the RITM form by selecting different choices.
The variables should be either hidden or shown depending on the choice.
Make sure the V1 variable is empty and hidden, then try updating or saving the form.
Expected results: The form is updated without any warning or errors since V1 should be hidden and not mandatory.
Actual Results: The form does not get updated, and shows an error "The following mandatory fields are not filled in: V1"
Create a new system property.
- Go to the sys_properties table.
- Create a new property with name "glide.sc.use_sc_form_v2" with the Type as true/false, and value as false.
- Save the form.
Related Problem: PRB1245555