Newer Version Available
Event Enrichment Considerations
Keep in mind these considerations when using enriched change events.
- No Apex Trigger Support
- Event enrichment isn’t available in Apex change event triggers.
- Packaging Support for Enriched Fields
- When you package a PlatformEventChannelMember component, fields selected for enrichment are included in the packaged component. However, they don’t display in the user interface in the package details page.
- No Grouping of Enriched Event Messages
- Salesforce sometimes groups event messages when the same change occurs in multiple records of one object during a transaction. For more information, see the recordIds field in Change Event Header Fields. However, if change event messages are enriched, no grouping of change events occurs because the external ID field values could be different for each record. Instead, single event messages are sent. Because these event messages are ungrouped, they contain duplicate ReplayId values but only one record ID in the recordIds field. You can still replay those events using the ReplayId option in Streaming API (CometD). Also, because change event messages aren’t optimistically grouped before being delivered to subscribers, event allocation usage could be higher.
- CampaignMember Change Event
- If a CampaignMember is deleted from a campaign, the change event message doesn’t include enriched fields because it’s a hard deletion—the record no longer exists in the database. The system can’t query the enriched field value for that record. However, if a CampaignMember is deleted as part of a cascade delete on the campaign, this deletion is a soft deletion, and the records are in the Recycle Bin. The system can query the soft-deleted record and obtain the enriched fields.
- Gap and Overflow Events
- Enriched fields aren’t supported for gap or overflow events.