Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
ChangeEventHeader Fields
Check out the descriptions of the fields that the change event header
contains.
| Field Name | Field Type | Description |
|---|---|---|
| entityName | string | The API name of the standard or custom object that the change pertains to. For example, Account or MyObject__c. |
| recordIds | string[] | One or more record IDs for the changed records. Typically, this field contains one record ID. If in one transaction the same change occurred in multiple records of the same object type during one second, Salesforce merges the change notifications. In this case, Salesforce sends one change event for all affected records and the recordIds field contains the IDs for all records that have the same change. Examples of operations with same changes are: update of fieldA to valueA in Account records; deletion of Account records; or renaming or replacing a picklist value that results in updating the field value in all affected records. The recordIds field can contain a wildcard value when a change event message is generated for custom field type conversions that cause data loss. In this case, the recordIds value is the three-character prefix of the object, followed by the wildcard character *. For example, for accounts, the value is 001*. For more information, see Conversions That Generate a Change Event. |
| changeType | Enumeration | The operation that caused the change. Can be one of the following values: CREATE, UPDATE, DELETE, UNDELETE, or SNAPSHOT (reserved for future use). For gap events, the change type starts with the GAP_ prefix: GAP_CREATE, GAP_UPDATE, GAP_DELETE, or GAP_UNDELETE. For overflow events, the change type is GAP_OVERFLOW. |
| changeOrigin | string | Only populated for changes done by API apps or from Lightning Experience; empty otherwise. The Salesforce API and the API client ID that initiated the change, if set by the client. Use this field to detect whether your app initiated the change to not process the change again and potentially avoid a deep cycle of changes. See the format and example for changeOrigin after this table. <API_Name> is the name of the Salesforce API used to make the data change (soap, rest, bulkapi, xmlrpc, oldsoap, toolingsoap, toolingrest, apex, or apexdebuggerrest). <API_Version> is the version of the API call that made the change and is in the format XX.X. <Client_ID> is a string that contains the client ID of the app that initiated the change. If the client ID is not set in the API call, client=<Client_ID> is not appended to the changeOrigin field. The client ID is set in the Call Options header of an API call. For REST API (and Bulk API and Bulk API 2.0), see Sforce-Call-Options Header. For SOAP API (and Apex API), see CallOptions Header. |
| transactionKey | string | A string that uniquely identifies each Salesforce transaction. You can use this key to identify and group all changes that were made in the same transaction. |
| sequenceNumber | int | The sequence of the change within a transaction. The sequence number starts from 1. A lead conversion is an example of a transaction that can have multiple changes. A lead conversion results in this sequence of changes within the same transaction: create an account, create a contact, create an opportunity, then update a lead. For more information, see Change Events for Lead Conversion. |
| commitTimestamp | long | The date and time when the change occurred, represented as the number of milliseconds since January 1, 1970 00:00:00 GMT. |
| commitUser | string | The ID of the user that ran the change operation. |
| commitNumber | long | The system change number (SCN) of a committed transaction, which increases sequentially. This field is provided for diagnostic purposes. The field value is not guaranteed to be unique in Salesforce—it is unique only in a single database instance. If your Salesforce org migrates to another database instance, the commit number might not be unique or sequential. |
| nulledfields | string[] | Available in Apex triggers and Pub/Sub API only. Not available in CometD. Contains the names of fields whose values were changed to null in an update operation. Use this field to determine if a field was changed to null in an update and isn’t an unchanged field. In Pub/Sub API, decode this field before you read its contents. For more information, see Event Deserialization Considerations in the Pub/Sub API Developer Guide. |
| diffFields | string[] | Available in Apex triggers and Pub/Sub API only. Not available in CometD. Contains the names of fields whose values are sent as a unified diff because they contain large text values. For more information, see Sending Data Differences for Fields of Updated Records. In Pub/Sub API, decode this field before you read its contents. For more information, see Event Deserialization Considerations in the Pub/Sub API Developer Guide. |
| changedFields | string[] | A list of the fields that were changed in an update operation. This field is empty for other operations, including record creation. This field includes the LastModifiedDate and LastModifiedById system fields only if they have changed compared to before the update. For example, if the update operations result in a new timestamp, or if a different user modifies the record. In Pub/Sub API, decode this field before you read its contents. For more information, see Event Deserialization Considerations in the Pub/Sub API Developer Guide. |
Format of the changeOrigin field value:
1com/salesforce/api/<API_Name>/<API_Version>;client=<Client_ID>Example changeOrigin value:
1com/salesforce/api/soap/49.0;client=Astro