The fictitious company, Codey Outfitters, distributes outdoor equipment from local small businesses to outdoor enthusiasts around the world. The company handles all logistics, such as complying with import laws for each state and country.
Over the years, Codey Outfitters has acquired different IT systems to manage orders, shipments, inventory, and billing. It uses Salesforce CRM to manage its customer base and the suppliers whose items it sells. Codey Outfitters wants to provide customers with a one-stop shopping portal where they can see price changes on the gear.
When the inventory is updated, Codey Outfitters wants the change notifications sent to its Salesforce org. Salesforce then performs business logic to determine whether the updates include price changes that are valuable to customers based on their order history. Customers can see or be notified about relevant deals on their Codey Outfitters portal.
Let’s see how Codey Outfitters sets up and uses external change data capture to accomplish these goals.
- Set Up the External Data Source and the External Object
Codey Outfitters has an OData 4.0 service for its inventory. The company connects its Salesforce org to the inventory by creating an external data source called Gear Inventory and creating an external object called Products. - Monitor External Change Data Capture
With external change data capture enabled, Codey Outfitters’ org polls the external system every 30 minutes. To monitor the tracking status, it queries the BackgroundOperation object. Codey Outfitters prefers to run SOQL queries in the Query Editor of the Developer Console, but you can use your preferred tool. - Subscribe to Changes with Streaming API
When Codey Outfitters runs its Bayeux client, the client subscribes to Streaming API on the products publication channel. - React to Changes with Apex Triggers
To automate your business with external change events, use Apex triggers.