Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
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,964 Super User 2024 Season 1 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,964 Super User 2024 Season 1 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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans