Preventing Orphan Records in Many-to-One Relationships | Microsoft Power Platform Functional Consultant Exam | Microsoft

Preventing Orphan Records in Many-to-One Relationships

Question

You create a many-to-one relationship between records in table A and table B in the Dataverse database.

Then, in a model-driven app, you delete the record from table B.

But you still can see the “orphan” records from table A.

You need to prevent this type of relationship's behavior that creates “orphan” records.

Please select the option that would prevent deletion of the parent record that has related child records.

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

Correct Answer: D

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 person and multiple email addresses.

One person can have multiple email addresses.

The person record is related to the multiple records in the Email table from the Person table point.

It is a One-to-Many relationship for a person record.

For the related email 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.

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 Remove Link option, you preserve the child records when a parent record is deleted.

If you use a Restrict option, you prevent the deletion of the parent records related to child records.

Many-to-one

Choose the Related table to which to create your relationship lookup. Learn more

Current (Many) Related (One)
Table * Table *
Pet * — 1 Account Vv

Lookup column display name *

Account

Lookup column name *

crlfe_ Account

> General

Advanced options

Type of behavior * ©

*
Referential Vv
Delete *
Restrict wv

Remove Link

Restrict

Option A is incorrect because the Parental type defines the child records' deletion when you delete the parent record.

It does not prevent the deletion of the parent record when the related records exist.

Option B is incorrect because the Referential Remove Link type defines the parent record's deletion without deletion of any related child records.

It does not prevent the deletion of the parent record when the related records exist.

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.

It does not prevent the deletion of the parent record when the related records exist.

For more information about Dataverse table relationship behavior, please visit the below URLs:

When you create a many-to-one relationship between records in table A and table B in the Dataverse database, it means that each record in table A can be related to many records in table B, but each record in table B can only be related to one record in table A.

In this scenario, when you delete a record from table B, the related records in table A will become orphan records. Orphan records are records in a database that refer to a parent record that no longer exists.

To prevent this behavior and ensure data integrity, you can use the Referential Restrict option. Referential Restrict means that you cannot delete the parent record if there are related child records in the child table. In other words, the database will prevent you from deleting the parent record if there are related child records. This option is also known as a "restrict delete" or "restrict cascade" rule.

Option A, Parental, is not a valid option. Option B, Referential Remove Link, allows you to delete a record in the child table and remove the relationship to the parent record, but it does not prevent orphan records. Option C, Custom Delete Cascade All, allows you to delete a parent record and all related child records, but it does not prevent orphan records if you delete a record from the child table.

Therefore, the correct answer is D, Referential Restrict.