Data Validation

The system validates data values using a metadata driven engine. The engine reads two sets of rules at runtime to determine what validation rules should be applied to each data value. These two sets are referred to as the base and the custom set of validation rules. The system always applies the validation rules in the base set before applying the rules in the custom set.

You can modify the custom set (see Customizing Validation Rules), but the base set cannot be modified.

Validation Rules

The following validation rules are available in the system:

 

CodeTable

This rule verifies that the value is a non-obsolete value in the code table. This rule takes the following argument:

TableName (required) - This indicates the table name of the code table to be referenced.

 

CommaSeparatedList

The CommaSeparatedList rule type validates that the field contains one or more values separated by a comma. Each field can have zero or one CommaSeparatedList validation rules.

HasControllingField

The ValidValues rule type configures a dependent field so that entry is required, allowed, or not allowed based on the value entered in a controlling field. You customize a field to be dependent on another field by modifying the validation rules for the EntityAttribute element in the custom business metadata. Validation rules for the dependent field are modified to add the HasControllingField rule type, along with arguments that identify the controlling field and conditional requirements. (see Configuring Dependent and Controlling Fields).

InvalidCharacters

This rule takes the following argument:

CharactersArray (required) - This verifies that the value does not contain any of the characters listed in the argument.  The CharactersArray argument should be set to the characters recognized as invalid. The list of invalid characters in the array should not be separated by spaces or commas.

IsDatetime

This rule verifies that the value is a valid datetime. This rule takes the following arguments:

MinDate (optional) – Use a value of Today. This verifies that the value must be today or a future date and time, and cannot be a date and time in the past.

MaxDate (optional) – Use a value of Today. This verifies that the value must be a past date and time or today, and cannot be a date and time in the future.

Use24Hr (optional) - This verifies that the time value must be in the 24-hour format.

IsEmail

The IsEmail rule type validates that the field contains an @ symbol and period. Each field can have zero or one IsEmail validation rules.

IsLatitude

This rule verifies that the value is a valid latitude. This rule requires no arguments.

IsLongitude

This rule verifies that the value is valid longitude. This rule requires no arguments.

IsNumber

This rule verifies that the value is a valid number. This rule takes the following arguments:

MinAllowed (optional) - This verifies that the value must be greater than or equal to the value specified in the argument.

MaxAllowed (optional) - This verifies that the value must be less than or equal to the value specified in the argument.

Precision (optional) - This verifies that the value's precision must not exceed the precision specified in the argument value.  The precision is defined by the number of total digits followed by a comma and then the number of decimal  digits (that is, if 4,2 was used, the largest value the number could store would be 99.99).

  • Note: If the IsNumber validation is placed on a character field, that field will be sorted in numerical order.

IsPercentage

This rule verifies that the value is a valid percentage between 0% and 100%. This rule requires no arguments.

IsPhoneNumber

The IsPhoneNumber rule type validates that the contents of the field match a (999)999-9999 format. Each field can have zero or one IsPhoneNumber validation rules.

IsRequired

This rule verifies that the value is not null, or an empty value. This rule requires no arguments.

IsSsn

The IsSsn rule type validates that the contents of the field match a social security number format: 999-99-9999. Each field can have zero or one IsSsn validation rules.

IsValidXml

The IsValidXml rule type validates that the field contains well formatted XML. Each field can have zero or one IsValidXml validation rules.

IsWeekday

This rule verifies that the value is a valid day of the week. This rule requires no arguments.

MaxLength

This rule takes the following argument:

MaxAllowed (required) - This verifies that the value's length does not exceed the number specified in the argument.

  • Note: The system currently supports a maximum length of 3999 for a character field when running with an Oracle database.

ReadOnlyAfterImport

The ReadOnlyAfterImport rule type identifies the field as being set to read-only after a value is imported into the system using a system import that sets RecordSource to "Import". Each field can have zero or one ReadOnlyAfterImport validation rules.

SystemGenerated

This rule identifies values that the user cannot set. The system sets these values for add and change operations.

SystemMaintained

The SystemMaintained rule type identifies the field as created and maintained by the system with a value that cannot be modified by the user. Each field can have zero or one SystemMaintained validation rules.

ValidValues

This rule takes the following argument:

ValuesArray (required) - This verifies that the value only contains one of the strings listed in the argument. The ValuesArray argument should be set to the valid strings separated by commas; the strings are case sensitive.

Related topics

Customizing Validation Rules

 

Blue bar indicating the end of the topic