SFDO-Community / declarative-lookup-rollup-summaries

Declarative Lookup Rollup Summaries (DLRS) is a community built and maintained Salesforce application that allows you to create cross object roll-ups declaratively - no code! For install instructions and documentation, visit our website https://sfdo-community-sprints.github.io/DLRS-Documentation/
https://sfdo-community-sprints.github.io/DLRS-Documentation/
BSD 3-Clause "New" or "Revised" License
696 stars 238 forks source link

"Apex Event trigger cannot handle batch operations on recurring events" (meaning Event.IsRecurrence2 == TRUE) Is there any way to use DLRS in realtime or scheduled mode WITHOUT BATCHING? #896

Open peternoges opened 4 years ago

peternoges commented 4 years ago

Hi @JimBTek and @afawcett, hope you are both doing well! I just revised the title and description and added an image. Let me know if I can provide any more information. Thank you!

Describe the bug The bug I'm reporting is that when a child Event 's "Recurring" flag is TRUE (meaning Event.IsRecurrence2 ==true) it seems that DLRS (whether in scheduled, or realtime) cannot rollup the Events.

image

To Reproduce Steps to reproduce the behavior:

  1. Go to DLRS and define a rollup from child Event to a parent object (realtime or scheduled)
  2. Create a parent record.
  3. Create an Event record under the parent and make sure Event.Recurrence == TRUE (ie a recurring Event). Save.
  4. Notice that the DLRS definition doesnt work when Event.Recurrence ==TRUE. (even though it will work on non-recurring events).

Expected behavior The DLRS rollup works GREAT when the child Event records are "non-recurring" (meaning Event.IsRecurrence2 ==FALSE), however the DLRS rollup DOES NOT WORK when when Event.IsRecurrence2 == TRUE (and I expect it to)

Suspected Root Cause: I suspect this MIGHT be because "UnexpectedException: Apex Event trigger cannot handle batch operations on recurring events".

I tested the Recurring Events (ones with Repeat checkbox ticked) with reasonable Series End Dates (as opposed to None for Series End Date), yet dlrs would not roll them up. See "Suspected Root Cause". Now I'm wondering if there's a way to use DLRS (in realtime or scheduled mode) WITHOUT BATCHING? If so maybe it will circumvent the suspected root cause. This article gave me hope that I could process recurring Events outside of trigger logic somehow but I am not sure what that would look like. I also tried setting the dlrs hierarchy custom setting to 1 but that did not solve the issue. image

afawcett commented 4 years ago

Moving this to an enhancement. Thanks so much for the detailed update! :-)