Support Article

Validation errors hidden on collapsed dynamic layout

SA-36870

Summary



Dynamic 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.


Error Messages

Not Applicable


Steps to Reproduce

  1. Create a dynamic layout and in the container settings set the header to be collapsible. Place a required field in the section.
  2. Create an instance case type and collapse the dynamic layout.
  3. Press submit to trigger Validation.
  4. Observe there is no indication that fields on the collapsed dynamic section are required.


Root Cause



This is an expected behavior.

Resolution



Perform the following local change:
  1. Set the validation rule for server side validation and use the when rule 'hasMessage' in the Expand when section in the Dynamic Layout Properties.
  2. Otherwise the below local change can also be done.​(Option one is the recommended path)
    1. 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.
    2. Add the code in UserWorkForm (script below)
    3. Change the submit button actions to have runscript before FinishAssignment, which will run the above function before submitting.
    4. Then for all the dynamic layouts, change the active when condition to '.IsClientSideError = false'​
<script>

function isFormValid()
{
var value = validation_validate();
pega.u.d.setProperty('pyWorkPage.IsClientSideError', value, '');
}
</script>

Published April 21, 2017 - Updated May 5, 2017

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.