I have a declarative COUNT roll-up summary field that is returning Negative values after upsert operations.
The roll-up summary COUNTS all fields where Checkbox = TRUE
The roll-up summary's child object is a junction object where both Parents are Master-Detail (Parent:Team - Detail: Team Member - Parent: Employee)
One the Parents is an object that stores data from an external data source (Employees) that is updated with the standard salesforce.com import custom object wizard on a regular periodic basis
This Parent (Employee) also has a trigger that passes the last modification date to the children and to the other related Parent (Team). e.g. I updated an Employee, that Employee is a part of a Team, ergo the Team was updated
When employees are upserted the Roll-up summaries are returning negative values in many cases
I am trying to decifer is this issue is a bug related to declarative roll-up summaries or it an issue with execution context of the trigger. It seems to be a bug given the summaries return Negative values. Logically, a COUNT should never return negative.
Salesforce Partner Support reviewed and confirmed the occurance but would not classify it as a "bug" stating:
"...Unfortunately the calculation of rollup summary fields is not always straight forward. Our R&D Team always works to correct any issues that might appear and to improve the functionality. To aid customers that are impacted by invalid summary fields, we have the option to do a mass recalculation..."
Understanding there is a workaround to force recalculation - I am having a hard time confirming that miscalculation only occurs on import and does not occur in any other case. Because of this, it makes it hard to use the value as accurate reporting metric.
Has anyone come across this issue, seen similar behavior, or has access to any documentation that documents Roll-up summary limitations / considerations?
Thanks in advance!