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

Add support for CDC (Change events) #6

Closed
jamessimone opened this issue Jan 4, 2021 · 1 comment · Fixed by #8
Closed

Add support for CDC (Change events) #6

jamessimone opened this issue Jan 4, 2021 · 1 comment · Fixed by #8

Comments

@jamessimone
Copy link
Owner

Giving people more options for invoking Rollup: https://trailhead.salesforce.com/en/content/learn/modules/change-data-capture/subscribe-to-change-events-using-an-apex-trigger

@jamessimone
Copy link
Owner Author

Started the re-work to include CDC support in v1.0.4 - forthcoming. Because CDC is async, there are some irregularities with the way data comes into Rollup that need to be considered:

  • Trigger.operationType is always AFTER_INSERT (requires re-working how the Trigger context is assigned to fit with CDC's model for updates, which comes from the changeType property on the ChangeEventHeader object)
  • Reparenting. This is a big one. CDC events come with a list of changed fields, and you would know based on the type of rollup being performed if the lookup field on the calc item had changed - but because the lookup/key field on the calc item would have already been changed (and because CDC does not include the prior field values in what gets sent), figuring out how to perform a recalculation on the old parent record is … difficult

I've made good progress on basic support for CDC and expect that to be released in the coming days, without tackling the reparenting issue highlighted above.

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

Successfully merging a pull request may close this issue.

1 participant