Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected Behavior with Rollup to Ultimate Parent #590

Open
PhilTerz opened this issue May 9, 2024 · 1 comment
Open

Unexpected Behavior with Rollup to Ultimate Parent #590

PhilTerz opened this issue May 9, 2024 · 1 comment

Comments

@PhilTerz
Copy link

PhilTerz commented May 9, 2024

Rollup to Ultimate Parent is presenting several issues. I have tried to test scenarios to find a pattern but it is not always clear. In general, the counts don't seem correct. Specifically I have noticed and replicated these when using a distinct count with ultimate parent:

  1. Deleting rolling-up child record from the ultimate parent causes the count to decrease by 2x the regular parent's number of children.
  2. Adding a rolled-up child record to the ultimate parent causes the count to increase by 1 + 2(regular parent # of children).
  3. Deleting a rolled-up child record from the regular parent causes the count to decrease by the remaining number of children on the regular parent. (Regular parent had 14 children, I delete one, the regular parent now has 13 children and the UP's count decreases by 13).
  4. Adding a rolled-up child record to the regular parent causes the count to increase by the new number of children. (Regular parent had 13 children, I create one, the regular parent now has 14 children and the UP's count increases by 14).
  5. Also, using the Recalculate Rollups LWC button on the ultimate parent only counts the ultimate parent's children.

I am less certain of how Ultimate Parent should work so perhaps I am mistaken. Are children from the ultimate parent supposed to get counted? In the wiki article example:

In this example, it's possible using Apex Rollup to take information from Contacts A, B and C and roll them all up to Account A.

If Account A had children, is Rollup to Ultimate Parent intended to count Account A's children also with Account B and C's? If A had its own child Contact X, should an ultimate Parent rollup COUNT result in four? This was the assumption I was operating on.

@jamessimone
Copy link
Owner

@PhilTerz I will have a to take a look and get back to you. I appreciate you providing examples!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants