The K2BTools Extensibility Forms module provides a robust set of standard validations to ensure the integrity and consistency of data entered by end users. These validations are implemented in the code found in the validation folder inside the K2BTools.Controls.DynamicForm module. You can use these validations as provided or enhance them to fit your specific requirements.
-
Character Fields:
-
Numeric Fields:
-
Date Fields:
-
Combo Box Fields:
-
The value received is compared against the available options in the combo box.
-
This ensures that only valid, predefined values are accepted.
-
The same validation applies when the combo box is a collection (i.e., multiple selections).
-
After the basic validations, any conditions defined in the form are evaluated.
-
Each condition must return true for the data to be considered valid.
-
If a condition does not return true, the error message associated with that condition will be shown to the user.
Note:
The parser used to process these conditions is not the same as the one used in GeneXus.
We recommend using parentheses generously to clearly indicate operator precedence in your conditions.
-
Variable not empty:
plain text
not VariableName = ''
Checks that the field is not empty.
-
Variable greater than 0:
plain text
VariableName > 0
Checks that the value entered is greater than zero.
-
Variable greater than 0 and lower than 10:
plain text
(VariableName > 0) AND (VariableName < 10)
Checks that the value is greater than zero and less than ten.
If the form contains collections (sublevels that are collections), the structural validations (structure, field type) are recursively applied to each item in the collection. This ensures that every entry within a collection adheres to the same validation rules as the main form fields.
You can enhance or customize the standard validations by modifying the code in the validation folder of the K2BTools.Controls.DynamicForm module to suit your specific business rules or requirements.
|