Hi everyone,
I've been wracking my brain trying to figure out the best solution to a problem I keep running into over and over. My company loves complicated rollups. Sometimes they can be accomplished by using the OOTB rollup, and sometimes not. In my scenario it is a calculation based on two aggregates that rolls up into an option set value:
Total "Green" Child Accounts / Total Child Accounts
If Total Green = 0, then Non-Customer
If Total Green > 0 and Total Green < Total, then Partial Customer
If Total Green = Total, then Full Customer
My current solution is to have a plug-in that triggers when the green field on the child account gets updated to recalculate the parent's status. However, the plug-in sandbox worker crashes, and I'm not sure why. All of my unit tests pass, so my best theory is that there are too many child records getting updated at the same time. Does anyone have any advice on how I could optimize this plug-in or change direction to make the behavior more consistent? Right now, I'm running a SQL script to identify and clean up the data discrepancies caused by the failures, but that's not sustainable.