Method clearValue on mandatory checkbox field does not let submit Catalog Item


Description

Using the method clearValue on a mandatory checkbox field will not allow to submit the Catalog Item.

Steps to Reproduce

1. Create a new Maintain item through sc_cat_item.do:
- Name: Test checkbox
- Save

2. Create the following variables:
a1. Type: Select Box
a2. Mandatory: True
a3. Active: True
a4. Order: 100
a5. Question: test
a6. Name: test
a7. Create two question choices:
a7.1. Text: TEST1
a7.2. Value: TEST1
a7.3. Order: 100
a7.4. Text: TEST2
a7.5. Value: TEST2
a7.6. Order: 200

b1. Type: Label
b2. Order: 200
b3. Question: label
b4. Name: label

c1. Type: CheckBox
c2. Active: True
c3. Order: 300
c4. Question: checkbox1
c5. Name: checkbox1

d1. Type: CheckBox
d2. Active: True
d3. Order: 400
d4. Question: checkbox2
d5. Name: checkbox2

3. Create a Catalog Ui Policies for the Maintain Item:
- Short description: test
- Active: True
- Catalog Conditions: test is TEST2
- On load: True
- Reverse if false: True
- Applies on Requested Items: True
- Run scripts: True:
Execute if false:
function onCondition() {
g_form.clearValue('checkbox1');
g_form.clearValue('checkbox2');
}

4. Create the following Catalog UI Policy Actions:
a.1. Variable name: checkbox1
a.2. Mandatory: True
a.3. Visible: True
a.4. Read only: Leave alone

b.1. Variable name: checkbox2
b.2. Mandatory: True
b.3. Visible: True
b.4. Read only: Leave alone

5. Try the Maintain Item.

6. Select TEST2 for the Select Box test.

7. Select checkbox2.

8. Click on Order Now. The Request is not submitted and a popup message shows: "The following mandatory fields are not filled in: label".

Workaround

After carefully considering the severity and frequency of the issue, and the cost and risk of attempting a fix, it has been decided to not address this issue in any current or near future releases. We do not make this decision lightly, and we apologise for any inconvenience.

As a workaround, in the Catalog UI Policy, use the following code in 'Execute if false':
function onCondition() {
   g_form.setValue('checkbox1', false);
   g_form.setValue('checkbox2', false);
}


Related Problem: PRB1111173