# Salesforce Trigger - Events

**Salesforce Trigger - Events** allows you to capture specific events that occur in Salesforce.

The trigger is activated by events that occur in the Salesforce environment, such as creating, updating, or deleting records.

When one of these events occurs, the trigger can perform certain actions, such as sending notifications, updating related records, and executing custom business processes. The use of triggers is recommended starting with version 56.0 of the Salesforce APIs.

## Parameters

Take a look at the configuration parameters of the trigger. Parameters supported by[ Double Braces expressions](/documentation/connectors-and-triggers/double-braces/overview.md) are marked with `(DB)`.

<table data-full-width="true"><thead><tr><th>Parameter</th><th>Description</th><th>Default value</th><th>Data type</th></tr></thead><tbody><tr><td><strong>replayPreset</strong></td><td><p>Determines how the system manages the recovery of lost events or subscription initialization.</p><p>You can choose between <strong>LATEST</strong> or <strong>EARLIEST</strong> to meet your specific event processing needs. </p></td><td>LATEST</td><td>ReplayPreset</td></tr></tbody></table>

## replayPreset

The replayPreset parameter determines how events are handled when a Subscription API is set up or when an event is lost due to connection issues or other temporary issues.&#x20;

You can select the following options

* **LATEST**: When a new subscription is set up or an event is missed, the system starts sending events from the most recent event available in the Salesforce topic. This ensures that you only receive events that occurred after your subscription was set up or after the last event you received.
* **EARLIEST**: When a new subscription is established or an event is missed, the system starts sending events from the oldest available event in the Salesforce topic. This ensures that you receive all events that have occurred since the beginning of the event history on the topic, including events that occurred before the subscription was established.

This is an example of the return of a Contact event:

```
"Received message":{
   "ChangeEventHeader":{
      "entityName":"Contact",
      "recordIds":[
         "003bm000000Y31tAAC"
      ],
      "changeType":"CREATE",
      "changeOrigin":"com/salesforce/api/rest/59.0",
      "transactionKey":"00002f60-27da-094a-ba8d-90655eb0bcd5",
      "sequenceNumber":1,
      "commitTimestamp":1712355719000,
      "commitNumber":1712355720007974913,
      "commitUser":"005bm000000oOZVAA2",
      "nulledFields":[
         
      ],
      "diffFields":[
         
      ],
      "changedFields":[
         
      ]
   },
   "AccountId":null,
   "Name":{
      "Salutation":null,
      "FirstName":"Maria X",
      "LastName":"Doe"
   },
   "OtherAddress":null,
   "MailingAddress":null,
   "Phone":null,
   "Fax":null,
   "MobilePhone":null,
   "HomePhone":null,
   "OtherPhone":null,
   "AssistantPhone":null,
   "ReportsToId":null,
   "Email":"maria.doe@example.com",
   "Title":null,
   "Department":null,
   "AssistantName":null,
   "LeadSource":null,
   "Birthdate":null,
   "Description":null,
   "OwnerId":"005bm000000oOZVAA2",
   "HasOptedOutOfEmail":null,
   "HasOptedOutOfFax":null,
   "DoNotCall":null,
   "CreatedDate":1712355719000,
   "CreatedById":"005bm000000oOZVAA2",
   "LastModifiedDate":1712355719000,
   "LastModifiedById":"005bm000000oOZVAA2",
   "LastCURequestDate":null,
   "LastCUUpdateDate":null,
   "EmailBouncedReason":null,
   "EmailBouncedDate":null,
   "Jigsaw":null,
   "JigsawContactId":null,
   "CleanStatus":"Pending",
   "IndividualId":null,
   "Pronouns":null,
   "GenderIdentity":null,
   "Level__c":null,
   "Languages__c":null
}

```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.digibee.com/documentation/connectors-and-triggers/triggers/others/salesforce.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
