Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Deleting only the active referential record

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

   I have a "Account" -parent entity related to child entity "purchase log".using cascading configuration how to set when parent record is deleted only the active child record associated with the related entity record should get deleted.(child record which are inactive should get deleted)

   can this be achieved using out of the box?  

*This post is locked for comments

  • Suggested answer
    Eccountable Profile Picture
    Eccountable 10 on at
    RE: Deleting only the active referential record

    Change the Relationship Behavior between the parent and child on the "Assign" behavior so that it will only "Cascade Active" records.  Make a workflow that changes the owner of inactive records to a system admin account. Remove the rights of the users on the child entity to delete the records they don't own. Now when a users deletes the parent account, the inactive child records will not be deleted.

  • Suggested answer
    gdas Profile Picture
    gdas 50,085 on at
    RE: Deleting only the active referential record

    Hi ,

    You may achieve this using plugin, register your plugin in  delete message.And make sure your relationship behavior should be default behavior that is "Referential".

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Deleting only the active referential record

    thanks for the reply das..

    what is the alternate way to achieve this?

  • Suggested answer
    gdas Profile Picture
    gdas 50,085 on at
    RE: Deleting only the active referential record

    Hi,

    You need to select the account 1: N relationship behavior as parental. In that case all child records irrespective of status active and Inactive will be deleted.

    Are you want to restrict  deletion of Inactive record?

    I am asking as you have mentioned in brackets  about Inactive records.

    Unfortunately out of the box you can not  control  restricted delete based on status  active or Inactive  so either all childs are deleted , restrict delete , and remove link can be achieved using configuration behavior.

    As in there is only three options available for delete criteria

    -Cascade All

    -Remove Link

    -Restrict

    So there is no option to restrict deletion of Inactive records or only active records.

    Hope this helps.

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,711 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,458 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans