Support Article
Custom message for Required field does not display
SA-84837
Summary
In a Validate rule, the default Required option is used and a custom message is provided. At runtime, the default message, 'This field may not be blank', displays instead of the custom message.
Error Messages
Not Applicable
Steps to Reproduce
- Create a Validate rule.
- Add a property and check the Required option.
- Provide a message in the Message option.
Root Cause
This behavior is as per Pega product design.
Refer to the below text from the Help document:
You cannot use a validate rule to present a custom error message for the specific case of a user who leaves a required field empty in an input form. In this case, the system presents a standard message "This field may not be blank." (In this case, the Validate tab has the Requiredcheck box selected for that particular property, no additional conditions to satisfy, and at run time the user leaves the field corresponding to that property blank on the input form.) If the validate rule specifies additional conditions (for example, a condition that the input value must be greater than a particular number) and a custom error message, and the user leaves the field blank, the system presents both the standard message and the custom error message because the blank input also fails the additional specified conditions.
Resolution
Perform the following local-change:
To display the custom error message for the Required field, use the function [expression evaluates to true] and the .property=="".
Published August 15, 2019 - 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.