web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Relationship Configuration: Opposite Direction, Parental Deletion?

(0) ShareShare
ReportReport
Posted on by

I want basically the opposite of the Parental Deletion.

Normally, when you delete a parent record, the child record is deleted; but if you delete a child record, the parent remains.

What I want to happen is: when you delete the child record, the parent is deleted. If the parent is deleted, child should also be deleted.

Is this possible? And if so, is it possible without code?

*This post is locked for comments

I have the same question (0)
  • Verified answer
    David Jennaway Profile Picture
    14,065 on at
    RE: Relationship Configuration: Opposite Direction, Parental Deletion?

    You could try:

    1. Create an additional relationship between the entities, but in the opposite direction, and set a Cascade Delete on this relationship
    2. Create a workflow that runs on the Delete of the child entity. In this workflow, set the lookup field for the new relationship from the parent to the child. This workflow would need to be a synchronous workflow on the Before step

    I'm not certain this would work; you may get a locking issue or a circular relationship error. If it doesn't work, you could write a simple custom workflow activity to delete the parent record (taking an input parameter to specify the record to delete), and call this from a workflow on the Delete of the child entity.

    Another option could be to set a flag field on the parent record (again via a workflow on the Delete of the child entity) and have a bulk deletion job that deletes records with this flag set. This will only run periodically (e.g. every week), so there would be a delay in the deletion

  • aforsythe Profile Picture
    on at
    RE: Relationship Configuration: Opposite Direction, Parental Deletion?

    I'm going to try the bulk delete - thanks!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#1
UllrSki Profile Picture

UllrSki 2

#3
ED-30091530-0 Profile Picture

ED-30091530-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans