KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Understanding 4D Field Validation
PRODUCT: 4D | VERSION: 13.0 | PLATFORM: Mac & Win
Published On: May 11, 2012

4D offers database-level validation on a per-field basis. There are two sections in the Inspector with different options, as below:

DefinitionData Entry


The validation options offered, like "Unique" or "Mandatory", are automatically enforced by 4D. It may seem redundant to have two sections in the inspector for validation settings but, in fact, there is an important reason for this.

The "Definition" section of the Inspector presents settings that are validated at the data engine level. Data-engine-level validation occurs in the data engine, there is no way to bypass it. No matter if a record is modified via a form, 4D code, or some other source settings in the field's Definition are always taken into account.

Data Entry validation, by contrast, occurs only in the context of a record edited via MODIFY SELECTION or created via ADD RECORD. These settings do not affect records modified in any other context whether by 4D code, external connections, import, etc. IMPORTANT: record data edited using fields in a dialog (using the DIALOG command) do not benefit from Data Entry validation.