The TableRelation property
The NAV Service Tier (NST) uses the TableRelation property of fields in tables to maintain data integrity.
There are plenty of fields in Dynamics NAV tables that are related to other tables. In a sales invoice, for instance, the Sell-to Customer No. field is related to the Customer table.
The relation is stated in the TableRelation property of the field. Sell-to Customer No. is related to the primary key field of the Customer table.
A relation is established for three important purposes, and two of them are related to data integrity:
- To establish data integrity: If TableRelation is defined, only values existing on the related table will be allowed to be written to the field. That is, you cannot create a sales invoice for a customer that does not exist.
This rule can be omitted if ValidateTableRelation is set to No.
- To maintain data integrity: If a value is changed in the primary key fields of a related table, the change will be propagated to all the tables...