Support Article

Custom filter section validation on report is not working

SA-39086

Summary



User need to validate date fields on a custom filter section of report, but edit validate is not firing on client side and it is firing on submit.


Error Messages



Not Applicable


Steps to Reproduce



1.Create a custom edit validate rule
2.Observe that when the case is run, the edit validate is fired on submit and not on focus out.


Root Cause



This is an expected behavior.

The issue is when the custom edit validate is used, it gets fired server side and not the client side.

The edit validates defined in the pega_validators.js are fired client side.

Resolution



Perform the following local-change steps, if custom edit validate rule has to be fired on client side:
  1. Create and test the edit validate rule.
  2. Associate an edit validate rule with a property.
  3. Create and test a JavaScript function that performs the same validation test as the edit validate rule, and has the same name. Follow the structure used in the standard text file rule webwb.pega_validators.js
  4. Save the JavaScript in a text file rule in your application RuleSet.
  5. Associate with the property a control rule that includes the ClientValidation control rule.
  6. Enable client-side validation, by a check box on the HTML tab of the Harness form. For best results use JSP tags and the SmartFrames format for the harness.
  7. Reference the text file rule containing the JavaScript function on the Scripts and Styles tab of each harness that can present the field as an input field, that is, in read-write mode.
  8. Test the process.

Check the following article for reference:

https://pdn.pega.com/sites/pdn.pega.com/files/help_v721/procomhelpmain.htm#rule-/rule-edit-/rule-edit-validate/related.htm

Alternatively, to call the validation on client side, one can write the javascript and call the runscript action on onchange event.

Published June 8, 2017 - Updated July 20, 2017

Have a question? Get answers now.

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