Support Article
On screen fields are validated when cancel button is clicked
SA-13467
Summary
Users have enabled Out of the box (OOTB) cancel button on the harness for both screen flows and process flows. However once clicked on the cancel button fields are validated hence user is not able to cancel the flow.
Error Messages
Error message pops up to validate errors before submitting.
Steps to Reproduce
1. Go to case which has client side validation enabled
2. Click on cancel task button
Root Cause
An issue in the custom application code.
Client side validation is being fired on Cancel button configured with activity ResolveCancelFlow.
Resolution
On click of CancelTask doFormSubmit() function is called. This is causing the form to be validated and the message show up.
Perform the following local-change:
Paste the following code in userworkform:
<script>
function enableValidation()
{
pega.u.d.bClientValidforReviewAction = true;
bClientValidation = true;
}
function disableValidation()
{
pega.u.d.bClientValidforReviewAction = false;
bClientValidation = false;
}
</script>
In pyCaseActionAreaButtons section, under cancelTask actions, add 2 additional run scripts – disableValidation (before doFormSubmit) and enableValidation (after doFormSubmit).
Now client side validation is not fired on Cancel.
Published August 31, 2015 - Updated December 2, 2021
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.