Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM forum
Answered

Want to update field on parent entity when the last child entity is delted( no child records on parent entity)

Posted on by 125

I want to get deleted row fields  with power automate but it seems its not possible unless we use plugin.

I have a child entity (lets say project) on parent entity (lets say Store) . I want to update the field on parent entity( field name is projectexits) to NO when no child record is assoicated with parent entity or every child entity is deleted 

I know it can be achieved with plugin preimage as I am new to dynamics , Can you please share me apporach for it ? Please let me know if otherway is also possible , I tied using Calculated filed but its not possible on 1:N relationship

  • Verified answer
    Bipin D365 Profile Picture
    Bipin D365 28,962 Moderator on at
    RE: Want to update field on parent entity when the last child entity is delted( no child records on parent entity)

    Hi,

    Check below article for delete plugin prevalidation stage

    nishantrana.me/.../

    You can write something similar to that and check the count of project record excluding the current record then update your field on parent entity

  • Dynamics_User07 Profile Picture
    Dynamics_User07 125 on at
    RE: Want to update field on parent entity when the last child entity is delted( no child records on parent entity)

    Hi Bipin,

    Thanks for ur suggestion we cannot use roll up field for some reason so we need to use the plugin only, any suggestion or sample code

  • Suggested answer
    Bipin D365 Profile Picture
    Bipin D365 28,962 Moderator on at
    RE: Want to update field on parent entity when the last child entity is delted( no child records on parent entity)

    Hi,

    Have you tried creating rollup field to store the count of project records?

    learn.microsoft.com/.../define-rollup-fields

    Now use Business rule to set your custom field is Project exist to yes when count >0 else set No

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,554 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,588 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans