You design a data model for a company and create a one-to-many relationship between Customers and Orders tables.
The company wants to keep the Orders records even if the Customers records are deleted.
What type of relationship should you define for the Customers and Orders tables?
Click on the arrows to vote for the correct answer
A. B. C. D.Correct Answer: B
Dataverse defines the two types of relationships between tables: One-to-Many (1:N) and Many-to-Many (N:N)
A one-to-Many relationship is a Parent-Child relationship, like between a customer and orders.
One customer can have multiple orders.
The customer record is related to the multiple records in the Orders table from the Customers table point.
It is a One-to-Many relationship for a customer record.
For the related order record, this relation is Many-to-One.
When you create such a relationship between tables, the Dataverse automatically adds a Lookup column in a child or related table.
When you relate two tables in the Many-to-One or One-to-Many relationship, you need to instruct the Dataverse what to do when you delete the records from the parent table.
There are three advanced options for relationship behavior: Referential, Parental, and Custom.
The Referential type preserves the child records from the actions on the parent records.
It has two options: Remove Link and Restrict.
If you use a Restrict option, you prevent the deletion of the parent records related to child records.
If you use a Remove Link option, you preserve the child records when a parent record is deleted.
Therefore, Option B is the correct answer.
Option A is incorrect because the Parental type defines the child records' deletion when you delete the parent record.
Option C is incorrect because Custom Cascade All defines the child records' deletion when you delete the parent record.
This behavior is the same as the Parental type.
Option D is incorrect because the Referential Restrict prevents the parent record's deletion without deletion of any related child records.
For more information about the Dataverse types of table relationship, please visit the below URLs:
Based on the requirements, the correct answer is B. Referential Remove Link.
Here's why:
When creating a relationship between two tables, there are several types of referential integrity actions you can choose from. These actions dictate what happens to the related records in the child table when a record in the parent table is modified or deleted. In this case, the requirement is to keep the Orders records even if the Customers records are deleted.
Option A - Parental - is not a valid option. There is no such thing as a "Parental" relationship type in the context of referential integrity.
Option B - Referential Remove Link - is the correct answer. This means that when a record in the parent table is deleted, the link between that record and any related records in the child table will be removed, but the child records themselves will be left intact. In other words, if a customer record is deleted, the orders that belong to that customer will still exist, but they will no longer be linked to that customer.
Option C - Custom Delete Cascade All - is not the correct answer. This option would delete all related records in the child table when a record in the parent table is deleted, which is not what the requirement calls for.
Option D - Referential Restrict - is also not the correct answer. This option would prevent a record in the parent table from being deleted if there are related records in the child table. This would not meet the requirement to keep the Orders records even if the Customers records are deleted.
In summary, the correct option is B - Referential Remove Link - as it allows the Orders records to remain even if the Customers records are deleted.