Incident Record Producer - Checkbox validation

patrykgasio
Tera Contributor

Hi all, i have requirement  :

As process owner I want a check box in ESC Incident form to be checked in case the highest Impact and Urgency are selected.

It is fulfilled when

- a check box in ESC Incident form is added in case the highest Impact and Urgency are selected.
- Text next to the check box is: "Please confirm, that you want to raise a Major Incident".
- only after the check box is checked the user is able to Submit the form.

The problem is that we have there already one checkbox and this will be a second checbox.

Firt checkbox that is realted to the sensitive informations appears always.

Second one will appear on the form only if impact and urgency are high.

Expected result is that if both checkbox are visible on the form, it is possible to submit a form only if both are checked. Currently it is not working as expected. I craeted new question as checkbox on the Record Producer + Catalog UI Policy + UI Actions + Client Script to validate both of them  :

function onSubmit() {
var isValid = true;
g_form.clearMessages();


var sensitiveValue = g_form.getValue('confirm');
var majorIncValue = g_form.getValue('major_incident_confirmation');

if (sensitiveValue == 'false' || sensitiveValue == '') {
g_form.addErrorMessage('Please mark: I confirm that I have not included passwords or sensitive information.');
isValid = false;
}

 


if (g_form.hasField('major_incident_confirmation')) {

if (g_form.getDisplay('major_incident_confirmation') === true) {
if (majorIncValue == 'false' || majorIncValue == '') {
g_form.addErrorMessage('Please mark: Please confirm, that you want to raise a Major Incident.');
isValid = false;
}
}
}


if (!isValid) {
return false;
}
}

 

 

But, the result is that : if 1st checkbox is marked, form can be submited without validating second checkbox. If second checkbox is marked, form cannot be submited and error message is displayed as expected : Please mark: I confirm that I have not included passwords or sensitive information.

 

How can i fix it to have the same result if only first checkbox is checked ?

Thank You !

0 REPLIES 0