Data validation against a pattern
In Pega Platform™ applications, you use validation to minimize the errors that can occur when users submit erroneous data. For example, during Case processing, users enter their Social Security number (SSN). You want to ensure that users enter an SSN in the correct nine-digit format that is divided by hyphens: 111-11-1111. To achieve this validation, you use an Edit Validate Rule, which is a Rule Type that validates character patterns. When users enter an SSN in the wrong format and click away from the field, an error message is displayed, as shown in the following figure:
In contrast to Edit Validate Rules, other validation mechanisms restrict the values users can enter. For example, property types ensure that users enter valid data, and drop-down lists limit input to approved choices. A Date/Time property can be used to ensure that users enter a valid date, while a drop-down list control can restrict users to predefined values.
Pega Platform provides predefined Edit Validate Rules for commonly used patterns. For example, these Rules validate whether property input values match specific formats, such as a Social Security Number (SSN), Taxpayer Identification Number (TIN), or Aadhaar ID. These Edit Validate Rules run on the client side when users move out of the property, such as by pressing the Tab key.
Edit Validate Rules do not restrict the values users enter. Instead, they are defined on properties and validate the format of the data entered by the user.
Edit Validate Rules normally run immediately when a user changes the value of a field, such as when the user tabs out of the field, because they are designed to validate the format of property values during user input. In contrast, a Validate Rule runs during processing, such as when a user submits a form. When you configure a Validate Rule to call one or more Edit Validate Rules, you defer field‑level validation until form submission. In this scenario, the Edit Validate Rules continue to validate the field’s data format, but they run at submission time rather than at data entry time, based on where the validation logic is invoked.
Check your knowledge with the following interaction:
This Topic is available in the following Module:
Want to help us improve this content?