Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Unanswered

OnDelete Rollup field autoCalculation request

(0) ShareShare
ReportReport
Posted on by 37
     else if (context.MessageName.Equals(/Delete/))
     {
         if (context.InputParameters.Contains(/Target/) && context.InputParameters[/Target/] is EntityReference)
         {
             Entity entity = (Entity)context.PreEntityImages[/Image/];
             EntityReference department = null;
             if (entity.Attributes.Contains(/mr_miss/))
             {
                 department = entity.GetAttributeValue<EntityReference>(/mr_miss/);
             }
                                                            
             CalculateRollupFieldRequest updateRequest = new CalculateRollupFieldRequest
             {
                 Target = department,
                 FieldName = /budgeta/
             };
             CalculateRollupFieldResponse updateResponse = (CalculateRollupFieldResponse)service.Execute(updateRequest);
         }
     }
 }
i wrote this plugin but the request is not working well unless i press on /Recalculate/ button , can someone help me with this?

 
  • RudyZhang Profile Picture
    Microsoft Employee on at
    OnDelete Rollup field autoCalculation request
    Hi,
     
    We have analyzed your requirements and based on the information you have provided, we are unable to determine if there is an error in your plugin code.
     
    We found a post in the Power Platform forums with a similar issue to yours, which provides a solution to force the Roll Up field to be calculated using /CDS Workflow + Plugin/.
     
    Please refer to the post in the link below
    https://powerusers.microsoft.com/t5/Microsoft-Dataverse/Force-rollup-fields-calculation/td-p/437860
     
     
     
    I hope my answer is helpful to you! If you have any other questions, please feel free to contact me.
     
    Best Regards,
    Rudy Zhang

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 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,261 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,996 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans