Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

Prevent deletion of 1:n associated record

(0) ShareShare
ReportReport
Posted on by 55

In Dynamics CRM it is not possible to delete e.g. an QuoteDetail as soon as the status of the owning Quote is active or closed (you can try to delete the QuoteDetail, but you get an error message). I think this behavior does make sense.

How is it implemented in Dynamics CRM? I would like to get the same behavior for custom entities linked with an 1:n association.

Thank you!

  • krombi Profile Picture
    55 on at
    RE: Prevent deletion of 1:n associated record

    Thank you!

    Hopefully Microsoft will add a more 'natural' solution at some point...

  • Verified answer
    meelamri Profile Picture
    13,216 User Group Leader on at
    RE: Prevent deletion of 1:n associated record

    Good job !! Yes go for the workflow, I forgot about that option !!

  • krombi Profile Picture
    55 on at
    RE: Prevent deletion of 1:n associated record

    Ah, damn. I forgot the add a link to workflow solution... Here it is: Prevent delete with workflows

  • meelamri Profile Picture
    13,216 User Group Leader on at
    RE: Prevent deletion of 1:n associated record

    Hi,

    can you please your real-time workflow ?

  • krombi Profile Picture
    55 on at
    RE: Prevent deletion of 1:n associated record

    Thank you, I'll look at the plugin solution.
    In the meantime I found a solution using real-time workflows. Seems to be working fine. But I don't know which solution I prefer. Do you have an opionion? (I'm totally new to Dynamics/CDS...)

  • meelamri Profile Picture
    13,216 User Group Leader on at
    RE: Prevent deletion of 1:n associated record

    Hi,

    Unfortunately you can't handle this scenario with OOB functionality, please check my first post.

  • krombi Profile Picture
    55 on at
    RE: Prevent deletion of 1:n associated record

    I think this won't help. With the cascading behavior I can only prevent deletion of the 1-side of the association as long as related entities exist.

  • gupta.ambar2009@gmail.com Profile Picture
    797 on at
    RE: Prevent deletion of 1:n associated record

    Hello ,

    Check configurable cascading behavior in relationship to restrict deletion of record .

  • Suggested answer
    meelamri Profile Picture
    13,216 User Group Leader on at
    RE: Prevent deletion of 1:n associated record

    Hi,

    Unfortunately you can't use OOB functionality to prevent deletion based on status. You need to write a plugin.

    Please refer to this Post to understand what is the message to use:

    community.dynamics.com/.../ms-dynamics-crm-associate-disassociate-message-plugin

    The plugin must execute in pre-validation. Basically, the plugin will raise an exception to stop the process.

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Daivat Vartak (v-9davar) Profile Picture

Daivat Vartak (v-9d... 225 Super User 2025 Season 1

#2
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 106

#3
Vahid Ghafarpour Profile Picture

Vahid Ghafarpour 82 Super User 2025 Season 1

Overall leaderboard

Product updates

Dynamics 365 release plans