Valid data is required so that the system can process the information without error. To prevent processing errors, Pega Platform provides field types and controls to support validation requirements.

Pega provides validate rules and edit validate rules. Validate rules are different from edit validate rules. Edit validate rules require Java programming skills to develop. Validate rules can call edit validate rules.

Example of validate rule – comparing two date , we can use the function available in pega

Example of edit validate rule – To check a number is positive or not

Example Scenario 

User A is entering his mobile in the application. It showed a certain format for mobile numbers .

For Example,

  • The number must start with +91 code.
  • The number must begin with 7 or 8 or 9.

Valid Format:

+917883443344

+918883443344

+919883443344

9883443344

Invalid Format :

+915883443344

5883443344

Configuration :

Step 1

Create castype called Validation and enter the step as mentioned below,

Step 2

Add the property called phone number

Step 3

Open the created property Phone number from app explorer . And in the advanced tab , the user validate field will be available . we need to create our custom edit validate rule.

Step 4 :

Create custom edit validate rule called FormatInputResponse and configured it as mentioned below,

Save all the rules.

Hurray!!! The implementation part is done .

Output :

Let us run the use case and verify our work.

Case 1I have entered the mobile number starts with 5 , so the error message is displayed as shown below,

Case 2Even Though the number starts with +91 , it is showing the error as it start with number 1

Case 3Let us check the positive scenario, the number starts with 8 , so no error occurs .

Case 4the number starts with 8 and also with +91 code , so no error occurs .

Let us also check the clipboard value.

Youtube Video: