Each Data Validation Template Card references one table, using the table number. The template will apply to all records of that type (i.e. all customers) unless a condition is set (this is detailed further on in the user guide)
The set of rules can then be built up on the lines beneath, here we can create one or more Data Validation Rules in the subpage.
On the new Validation Template Card, create a code and complete a description, then choose the Table that holds the data to be validated, using the assist edit drop down list of all the tables.
The field Validate Condition allows you to specifically filter the records that you want to validate, this will be explained further on in the user guide.
The last two fields on the header of the data validation template are Block Record on Failed Valid and Blocked Value. Choosing to enable this option means that if a record within that template fails validation the record will not only be highlighted in the Data Validation Error List (detailed further on in the user guide), but the whole record is then blocked for processing purposes. This purposes come from the option selected in the field Blocked Value.
If the enable the option Block Record on Failed Valid selected, you can then choose the Blocked Value. The options presented are options presented are the options that come from the table.
NB: This option only works if the table allows the record to be blocked, for example an item can’t be blocked for any reason, whereas a customer or vendor can be blocked.
To create the actual rules, on the lines use the assist edit button to drop down the list of field numbers for the chosen table. Once a field number is chosen, the system will complete the field name, and we can then choose the Type for how we wish to validate the contents of that field.
The types of rules that can be created are:
-
Must Equal - the specified field must match the value that is entered in the Value column.
-
Must match the filter - the specified field must have a value that falls within the filter specified in the Value column. The filter expression must match the type of data that is stored in the field specified.
-
For example, use \<>'' (different to blank) to indicate that the field must have a value;
Use >0 to indicate that a numeric field must have a value greater than zero.
-
Must be a certain length - the specified field must have a value that contains the number of characters set in the Value column.
A user-friendly error message is then entered. In the examples below %1 means, it will use the field name in the error message. A translation of these error messages can be provided for use if you have other languages installed within Dynamics 365 Business Central.
A condition can be applied to a template card so that it only applies to a certain subset of the records from that table, so in this case only to the customers in the EU, for example.
This allows the validation rules to be more specific, for example in deciding what the various posting groups should be set to for this type of record.
NB: The rules on the Data Validation Template Card will only apply if the Enabled box has been ticked.