Newer Version Available

This content describes an older version of this product. View Latest

Event Enrichment Considerations

Keep in mind these considerations when using enriched change events.

As a beta feature, Change Data Capture Enrichment is a preview and isn’t part of the “Services” under your master subscription agreement with Salesforce. Use this feature at your sole discretion, and make your purchase decisions only on the basis of generally available products and features. Salesforce doesn’t guarantee general availability of this feature within any particular time frame or at all, and we can discontinue it at any time. This feature is for evaluation purposes only, not for production use. It’s offered as is and isn’t supported, and Salesforce has no liability for any harm or damage arising out of or in connection with it. All restrictions, Salesforce reservation of rights, obligations concerning the Services, and terms for related Non-Salesforce Applications and Content apply equally to your use of this feature. You can provide feedback and suggestions for Change Data Capture Enrichment in the Trailblazer Community. For information on enabling this feature in your org, contact Salesforce.

Note

No Apex Trigger Support
Event enrichment isn’t available in Apex change event triggers.
Latest Enriched Field Value Returned When Replaying an Event Message
Change event messages are stored in the event bus for a temporary duration. When you retrieve an event from the event bus using a replay option, enriched fields are added to the event message before delivery. As a result, if the enriched fields were updated after the event was stored, the replayed event message contains the latest value and not the original value. The only exception is when the enriched fields are part of the changed fields for the event. In this case, their values reflect the correct changed values.
Duplicate Replay ID for Ungrouped 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, single event messages are sent because the external ID field values could be different for each record. Because these event messages are first grouped and then ungrouped, they contain duplicate ReplayId values and 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.