LinkedIn
Copied!

Table of Contents

Validating user input and preventing invalid values

Ensure that only numbers can be entered for employee Social Security numbers.

Assume that in the Employee class, a property named SSN defines the employee’s Social Security number.

Do these steps to ensure that only numbers can be entered for the SSN property.

  1. In the navigation pane of Dev Studio, click App, and in the class field, enter Employee.

  2. In the navigation area for Employee, expand Data Model Property and click the SSN property.

  3. On the Advanced tab, enter the following values:

    1. To ensure that 9 characters must be entered for SSN values, enter 9 in the Max length and Expected length fields.

    2. To ensure that only numbers can be entered for SSN values, in the Use validate field, press the Down arrow key and click IsPositiveInteger. The IsPositiveInteger edit validate rule, which is part of Pega Platform, ensures that only positive integers can be entered. You can create additional edit validate rules for custom edit checks.

    For more information, see Property form - Completing the Advanced tab.

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.