Validation errors hidden on collapsed dynamic layout
SummaryDynamic Layouts with Collapsible headers can be collapsed to save space on a form, but can contains fields marked as required.
When a user does not enter values in a required field, validation will fire. However, as the Dynamic Layout is collapsed the users cannot see the field and there is no mark on the Dynamic Layout header to highlight where those missing fields are located.
Steps to Reproduce
- Create a dynamic layout and in the container settings set the header to be collapsible. Place a required field in the section.
- Create an instance case type and collapse the dynamic layout.
- Press submit to trigger Validation.
- Observe there is no indication that fields on the collapsed dynamic section are required.
Root CauseThis is an expected behavior.
ResolutionPerform the following local change:
- Set the validation rule for server side validation and use the when rule 'hasMessage' in the Expand when section in the Dynamic Layout Properties.
- Otherwise the below local change can also be done.(Option one is the recommended path)
- Create a property, suppose "IsClientSideError" and place this property in the section where you have collapsible layouts. Configure onChange Refresh Section for this property. And hide this property using display:none; style in advance presentation options.
- Add the code in UserWorkForm (script below)
- Change the submit button actions to have runscript before FinishAssignment, which will run the above function before submitting.
- Then for all the dynamic layouts, change the active when condition to '.IsClientSideError = false'
var value = validation_validate();
pega.u.d.setProperty('pyWorkPage.IsClientSideError', value, '');
Published April 21, 2017 - Updated May 5, 2017