Track Data Changes to External Objects More Easily (Generally Available)

With External Change Data Capture, now generally available in Salesforce Connect using the OData 4.0 adapter, you can track changes made to data that’s stored outside your Salesforce org. You can build automation to respond to changes to increase productivity or provide a better customer experience. And you can now distribute External Change Data Capture components in managed packages, including a framework for testing your Apex triggers. External Change Data Capture was called External Data Change Tracking in its Winter ’18 pilot release and renamed Trigger in its Spring ’19 beta release.

Where: This change applies to Lightning Experience and Salesforce Classic as part of Salesforce Connect using the OData 4.0 adapter. Salesforce Connect is free for Developer Edition and available for an extra cost in Enterprise, Performance, and Unlimited editions.

How: Configure the external data source to allow Salesforce to monitor changes according to OData standards. Enable External Change Data Capture on external objects by selecting to track data changes for an object. After you enable change tracking, a publication channel is created under the topic for the external object. For example, /data/Object Name__ChangeEvent appears as data/Products__ChangeEvent. Salesforce polls the external system at configurable intervals for tracked changes.

Use Apex triggers to subscribe to change events, or use a Bayeux client to subscribe to Streaming API on the publication channel. After subscribing, observe change event notifications after you perform a DML operation on an external object. Changes to the external object from within Salesforce and changes made outside of Salesforce are tracked.

To help you test Apex triggers that use External Change Data Capture, a unit test code example of a trigger reacting to a simulated external change is available in the Developer Guide. Include External Change Data Tracking components in a managed package by selecting your test from the Apex Class Component Type list. The trigger, test, External Data Source, external object, and other related assets are brought into the package for distribution.