Table relations
We already know that the Sales Line
table is related to the Sales Header
table. But how do we tell Dynamics NAV about the relationship between these two tables?
The table relation for the fields is defined in the properties of the field. Go ahead and click on the Document No. field in the Sales Line
table and find the property called TableRelation:
Click on the AssistEdit button to bring up the Table Relation screen. The AssistEdit button is the button that looks similar to three dots:
Clicking on the AssistEdit button will tell us the table relation that's associated with that field:
From the Table Relation screen, click on the AssistEdit button to bring up Table Filter; this will tell us the relation criteria:
From the previous screenshots, the sentence you would construct would be this: The Document No. field is related to the Sales Header No. field, where the value on Document Type on the Sales Line table has to equal to the Document Type on the Sales Header table.
Make sure...