To support the flexible nature of Microsoft Dynamics NAV, the Adapter for Dynamics NAV lets you define how field-level validation should occur. These field-level validation options are defined in the Dynamics NAV database.
By default, the Adapter for Dynamics NAV validates information before the records are inserted or updated. However, the Dynamics NAV adapter does not call OnValidate() for each field in every table. Include support for field-level validation by adding entries to a settings table.
Note: A file containing default validation setup is available as part of the Adapter for Dynamics NAV. Typically, it can be imported from the following location: C:\Program Files\Microsoft Dynamics NAV\ApplicationServer\ScribeModifications\Common. If any modifications are made to the default validation setup imported from file, the changed setup data can be exported for further use.
To define field-level validation
Note: Integrating data into a Microsoft Dynamics NAV object that is not explicitly listed in the Scribe Validation Rules table generates an exception. Any object you want to integrate with must be listed in this table.
Validation rules
Column Name | ||
---|---|---|
Option | Description | |
Table Name | ||
Table Name | NAV table whose behavior is being modified. Either type or select from the list of the Table Objects the name of the table to be used. | |
Operation | ||
Operation |
Operation that invokes the custom validation behavior. Choose Insert, Modify, or InsertAndModify. Two rows can be added to a table if different validation logic is required for inserts and modifications. |
|
Validation Mode | ||
None | Perform no field-level validation. This is the default. Select this option to revert the associated table listed in Table Name back to the default behavior without having to remove the listing from the Scribe Validation Rules table. | |
Validate | Call OnValidate() for applicable fields before updating or inserting the record into the table. | |
InsertValidateUpdate |
Behavior differs for Insert and Update operations:
This mode is intended for a record that needs to be inserted into its Microsoft Dynamics NAV table before field-level validation occurs. The inserted record needs to be updated with any new values. Objects that autocalculate IDs are common candidates for this type of validation. For example, a record has to be inserted to receive an auto-calculated ID, then other fields can be validated and the initially inserted record can be updated as appropriate. |
|
Fields To Validate | ||
SetFields |
Only invoke the OnValidate() method associated with the fields that are set by Insight. |
|
NormalFields | Only invoke the OnValidate() method associated with ”normal” fields, whether set by Insight or not. This option does not include atypical fields, such as flow fields. | |
AllFields |
Invoke the OnValidate() method for all fields, including flow fields. |
|
Field Order Override | ||
Field Order Override |
Optional, only validate fields whose field Ds are listed in this comma-separated list. Fields are listed in the order in which they should be validated. Either type or select from the Field List the numbers of the fields to be used. The maximum size is 250 characters. For field lists that are longer than 250 characters, use this field with the Field Order Override 2 field.
The Fields To Validate rule is still honored within the list. When combined with the SetFields option, only those fields listed and set by Insight are validated.
To override the ValidationMode, specify operations in the validation with:
For example:
|
|
Field Order Override 2 | ||
Field Order Override 2 | An expansion of the Field Order Override field for lists that exceed 250 characters. Use this if you need additional space for field IDs to validate. If the list in the Field Order Overrride field ends with a Field ID or letter (such as I or U), the list in this field must start with a comma. |
See also
Importing Default Validation Rules