Support Article
Error message displayed on Harness
SA-31964
Summary
User has a property-set-message on a property to throw an error message when the value is blank. When a value is entered for the property after the validation has been fired, the error message is displayed on top of the harness. There is no error message displayed on the Clipboard or tracer though.
Error Messages
Not Applicable
Steps to Reproduce
- Add a property-Set-message to a property to display an error if no value is entered in an activity.
- At run time, tab out without adding a value. Error message will be displayed near the property.
- Now, enter a value for the property and tab out. Error will now be displayed at the top of the harness.
Root Cause
Pega maintains a div with ERRORMESSAGES_ALL as ID, which holds all the errors in the response. This div is not shown initially as the property is already in the DOM, and a field level error is displayed. Once the field level is updated with a valid value, this change will not be propagated to the original div based on which the form error is displayed. This is a known limitation of the product.
Resolution
Perform the following local-change:
Place the below code in userworkform or in the harness specific scripts.
<script>
pega.u.d.attachOnload(function (){
$("#ERRORMESSAGES_ALL:hidden").remove();
$("#ERRORTABLE:hidden").remove();
$("#ERRORTABLE:hidden").remove();
},true);
</script>
Published January 3, 2017 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.