Track Data Changes to External Objects More Easily (Generally Available)
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.