Custom message for Required field does not display
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.
Steps to Reproduce
- Create a Validate rule.
- Add a property and check the Required option.
- Provide a message in the Message option.
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.
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=="".
0% found this useful