6 min readRishi

Dataverse Cascade Delete: Parental, Restrict, and the Children You Lose

Dataverse Cascade Delete: Parental, Restrict, and the Children You Lose

Deleting an account should not be a surprise about contacts. In Dataverse that surprise is a property of the one-to-many relationship, not of the delete button. The relationship type picks a preset. Custom lets you set each action. Get the delete action wrong and you either wipe child rows or block a delete nobody can explain.

Microsoft documents the cascade options on the relationship cascading behavior page. The designer is just that table, with a preset painted on top.

The three presets

TypeDeleteAssign, share, reparent
ParentalCascade All. Children are deleted with the parentThose actions cascade too
Referential, Restrict DeleteThe parent cannot be deleted while a child points at itDo not cascade
Referential, Remove LinkThe parent is deleted and the child's lookup is clearedDo not cascade

Parental is the one that destroys data. The account-to-contact relationship that ships as parental is the familiar case: delete the account and the contacts whose parent customer is that account are deleted with it. On that built-in relationship the delete behavior is locked to Cascade All. The designer will not let you switch it to Restrict. Opportunities on a parental relationship go the same way. Parental is correct when the child has no meaning without the parent, the way an order line has no meaning without the order. It is the wrong model for a case, a note you still need, or a contact who also sells to someone else. A custom relationship is where you still get to choose.

Restrict is the opposite contract. The delete fails while children exist, and the user has to remove or reparent them first. The error is annoying and it is the point.

Remove Link orphans on purpose. The child stays, the lookup becomes empty. Use it when the child is a real record that should survive, and an empty parent is an allowed state. If the lookup column is required, it cannot be cleared, and the delete fails anyway. Remove Link is not a quiet Restrict. It only works when empty is a legal value.

Walk one account delete before you ship the type

Say contoso is an account. It has three contacts with parentcustomerid pointing at it, one closed opportunity, and a custom project row whose lookup you created last sprint.

Delete contoso.

  • Contacts on the parental account-to-contact relationship are deleted. Plugins and flows on contact Delete run for each of those rows. Restore from backup if you needed them.
  • A closed opportunity still follows Parental. Closed does not mean "leave it." Delete does not offer Cascade Active.
  • The custom project follows that relationship. Parental: gone. Restrict: the account delete fails. Remove Link with an optional lookup: contoso goes, the project lookup is null.

One click, three relationships, three decisions. The form does not preview that list. Rehearse in a sandbox: delete one parent, query children by id, then decide.

Delete is not the only action

Cascade configuration is per action. Delete accepts only Cascade All, Remove Link, or Restrict. Assign, share, unshare, and reparent also accept Cascade Active and Cascade User Owned.

Cascade Active touches active children and leaves inactive ones on the old parent. Cascade User Owned touches children owned by the same user as the parent and leaves everyone else's rows where they are. After an assign, those skipped rows still point at the parent and still show the previous owner. That is how ownership and the lookup drift apart. If the business rule is "the team that owns the account owns its contacts," Parental or Cascade All on assign is the setting that enforces it. Cascade User Owned will not move a contact another user owns.

Reparent is the column people skip. Change a contact from account A to B and related sharing or ownership may follow — or may not. Read Reparent, not only Delete.

Merge is narrower. On tables that can be merged, Cascade is the only valid merge behavior: the children follow the surviving row. There is no Restrict option on merge. Test merge with two parents that each have children before a role uses it daily.

Custom vs locked system relationships

You can change cascade on a custom 1:N. You often cannot change it on the system relationship. Account-to-contact delete stays Cascade All. If contacts must survive, they cannot use that parental lookup as their only parent, or you reparent first, or you do not delete accounts.

A custom new_accountid on contact is a second relationship. It can be Restrict while parent customer stays Parental. Deleting the account still kills contacts on the system lookup. Two lookups, two cascade graphs.

The type is metadata and travels in the solution. A managed import can overwrite what you set in dev. Read the relationship in the layer you will ship. Changing Parental to Restrict does not restore rows a previous delete already removed. It only changes the next delete.

When Parental is the wrong default

Do not pick Parental because "these records belong together in the form." Belonging in a subgrid is a navigation choice. Cascade is a lifetime choice.

Skip Parental when the child is referenced from anywhere else, when the lookup is required and you were about to pick Remove Link (that combination fails), or when inactive children must survive — delete has no Cascade Active. Skip it when a plugin or flow on child Delete is irreversible; Cascade All will run it for every child.

Use Restrict when a human should see the blockers. Use Remove Link when the child is first-class and null parent is a valid state. Use Parental when deleting the parent without the children would leave rows that cannot be interpreted, like line items without a header.

Many-to-many relationships do not use this cascade model; they have an intersect row instead. Deleting one side removes intersect rows, not the records on the other side. That choice is covered in native and manual many-to-many. Who may delete the parent is still a security role, separate from what the relationship does after the delete is allowed.

Checklist before the first real delete

  1. List every 1:N where this table is the parent — system and custom.
  2. Write Delete / Assign / Reparent / Merge as they actually are.
  3. Confirm required lookups. Remove Link plus required = failed delete.
  4. In a sandbox, delete one parent, query children by id, and note which plugins ran.
  5. Assign the parent and check child owners for Cascade User Owned leftovers. Merge two parents and confirm children landed on the winner.
  6. Import the solution to a clean environment and re-read the relationship.

If you cannot complete step 4, hide the delete privilege until the cascade is the one you mean.

Keep reading

Newsletter

New posts, straight to your inbox

One email when a new post goes up. Double opt-in, unsubscribe anytime. Not a daily digest.

Comments

  • No comments yet. Be the first.