Field Constraints

You can enforce a particular format on fields associated with a document class by using regular expressions.

To create field constraints

  1. Right-click a document class and select Configure fields. You can also select a document class, then click Configure fields in the bottom of the Tasks Pane on the right.
  2. In the General tab of the Configure Fields dialog box, select the name of a field.
  3. Click Constraint.
  4. In the ClosedField Constraint dialog box, specify a pattern matching expression that will be used to format the field.

  5. Example: For a field designed to contain Social Security numbers, you could enter the expression \d\d\d-\d\d-\d\d\d\d to restrict the field to data in the format of digits and dashes of a standard Social Security number.

  6. In the Constraint Violation Message box, specify the message that will be displayed to the user that will inform them that a value is invalid and provide tips for how to specify a valid value.

    Example: "Social Security numbers must be in the format ###-##-####."