This guide goes over the three methods for real-time access to new or updates Salesforce objects.
Change Data Capture (CDC)
Change Data Capture (CDC) is a native feature in Salesforce that enables the platform to emit events when objects are created or modified. Tekst can subscribe to these events to receive real-time updates on new or updated records.
Limitations
-
Since Salesforce controls the event stream, CDC offers limited configurability.
-
Not all Salesforce editions include access to CDC, and the number of events allowed depends on your specific Salesforce subscription plan.
Setup
- Login as Salesforce Administrator.
- Go to "Setup" > "Integrations" > "Change Data Capture".
- Select Case Entity (Right Column):
- Ensure the case is available to the selected entities.
- Move the case from available entities to selected entities if needed.
Platform Events
Platform events are a native feature in Salesforce and function similarly to Change Data Capture. They can be used to emit events related to object changes, including creations. Platform Events are more configurable and customizable, offering more flexibility and control. However, they are not available out of the box - they must be manually configured by your Salesforce administrator.
Note: Platform Event API names always end with the suffix ___e_. Be sure to include this suffix when referencing or configuring the event.
Setup
- Login as a Salesforce administrator.
- Go to "Platform Events" under "Setup" and click "New Platform Event".
- Fill in a the requested fields (label, plural label, description). Keep the Publish Behavior on default or 'Publish After Commit'. Save these settings.
- In the Custom Fields & Relationships related list, click "New".
- Create a Case_Id_c (id of the case that is updated) field and an Event type ("new" or "update") field. You can add other custom fields by selecting the type and filling in the Label/Name.
All field types that platform events support are:
- Checkbox
- Date
- Date/Time
- Number
- Text
- Text Area (Long)
Publish events
After creation this event still needs to be fired.
There are a few methods, we would like to reference to the following Salesforce Trailblazers guide for the different methods.
Custom Hook
As an alternative to the Salesforce CDC API, Tekst offers the option to send custom webhooks (via SFDC) to notify the platform of custom object creations or updates.
Setup
Web-hook origins are verified by Tekst using an API-key, stored in the 'x-API-key' header. For each request to the hooks endpoint of Tekst, only valid and authenticated web-hooks will be processed.
To get an API-key, follow the next steps:
- Navigate to "Integrations" under the "Settings" tab.
- Click "Edit" on the Salesforce Integration if you want to add a custom hook.
- Click "Create new key".
- Click the copy button to copy the key.
Important: You can have a maximum of two API-keys active at any given time. If needed, revoke older keys to generate new ones.
Be aware: after closing this pop-up, you will no longer be able to view this key.To revoke the key:
Revocation
- Navigate to "Integrations" under the "Settings" tab.
- Click "Edit" on the SAP Service Cloud v2 Integration
- Navigate to the key you want to delete and click "Revoke"
Hook request
For custom webhook integration, an authenticated POST request must be sent to the following endpoint, using the specifications outlined below:
The integration=xxx should contain the integration id, this can be copied from the example code.
| Request type | POST |
| URL | https://api.tekst.com/api/integrations/salesforce/hook?integration=xxx |
| Authentication | x-API-key header with a valid key for this connector*. |
| Payload |
{ "eventType": "new" | "update", // depends on if it's a new or an update of an Object "caseId": "id" // the salesforce unique identifier: case Id } |
Comparison
| Topic | Change Data Capture | Platform events |
| Setup | Salesforce native, not much configuration Channels with filtering will have to be created and configured |
More setup needed: Need to setup the triggers and create platform event (not native). |
| Configurability | Really minimal, only object is configurable Filter for channels can be used to fire limited set of events |
Really configurable, can add fields that will broadcast. Only broadcast on certain relevant cases, only update on a close etc. |
| Trigger | Not configurable On every create, update and delete of a case, delete events may be less relevant Filter for channels can be used to trigger relevant cases. Update of a case by Tekst will re-trigger an event |
Configurable Only on create and important update events |
| Limits |
Salesforce Salesforce Limit on CDC events, similar to platform events |
Salesforce Salesforce Limit on platform events, similar to CDC |
| Split between Salesforce child instances* | Events only get split to the child event in a later time once it has been fetched. A bit less resource split compared to platform events. | Can send the in the platform event immediately the field on which a child gets split off resulting in an earlier division of resources. Effect is minimal. |
* Salesforce child instances is a concept that Tekst uses to split 1 salesforce instance connected to the platform in multiple separate inboxes instead of one.
Advantages are: stricter permissions, more control on models and resource split between each child instance.
0 comments
Please sign in to leave a comment.