The Validation Element
An element that describes a Datasheet validation rule.
A Datasheet validation rule is applied to all records in the datasheet for the specified columns.
Attributes and Elements
Attributes
Attribute | Description | Required |
---|---|---|
validationType | The type of the validation. See Validation Types below. | Yes |
columns | The columns for the validation (separated by the pipe character) | Yes |
Child Elements
None.
Parent Elements
Element |
---|
validations |
Validation Types
Value | Description |
---|---|
Unique | The values in the column(s) must be unique for all records in the Datasheet. When multiple columns are specified, the combination of those values must be unique for all records in the Datasheet. |
UniqueOrNull | The values in the column(s) must be unique or NULL for all records in the Datasheet. When multiple columns are specified, the combination of those values must be unique for all records in the Datasheet. |
LessEqual | The value in the first column must be less than or equal to the value in the second column |
Examples
<validations>
<validation validationType="UniqueOrNull" columns="ID"/>
<validation validationType="Unique" columns="StateLabelXID|StateLabelYID"/>
</validations>
In the example above:
- The first validation ensures that the value for the ID column is either unique or NULL for all records in the Datasheet.
- The second validation ensures that no two records have the same combination of values for StateLabelX and StateLabelY for all records in the Datasheet.
<validations>
<validation validationType="LessEqual" columns="MinimumIteration|MaximumIteration"/>
<validation validationType="LessEqual" columns="MinimumTimestep|MaximumTimestep"/>
</validations>
In the example above:
- The first validation ensures that the value for MinimumIteration is less than or equal to the value for MaximumIteration for all records in the Datasheet.
- The second validation ensures that the value for MinimumTimestep is less than or equal to the value for MaximumTimestep for all records in the Datasheet.