Salesforce
The Salesforce destination writes data to Salesforce objects with the SOAP or Bulk API. To write to Salesforce with Salesforce Bulk API 2.0, use the Salesforce Bulk API 2.0 destination. For information about supported versions, see Supported Systems and Versions in the Data Collector documentation.
When you configure the Salesforce destination, you define connection information, including the authentication type, and the API type and version to use to connect to Salesforce. You can also use a connection to configure the destination.
You specify the Salesforce object to write to by entering the object name or by defining an expression that evaluates to the object name.
You can write Salesforce platform events as you write to any Salesforce object by using
the platform event API name, for example, Notification__e
, rather than
a Salesforce object type API name such as Account
or
Widget__c
.
The Salesforce destination can use CRUD operations defined in the
sdc.operation.type
record header attribute to write
data. You can define a default operation for records without the header
attribute or value. You can also configure how to handle records with
unsupported operations.
For information about Data Collector change data
processing and a list of CDC-enabled origins, see Processing Changed Data.
By default, the Salesforce destination writes data to a Salesforce object by matching case-sensitive field names. You can override the default field mappings by defining specific mappings that the CRUD operation requires. For update and delete operations, the incoming record must contain the record ID.
You can optionally use an HTTP proxy to connect to Salesforce. When enabled in Salesforce, you can configure the destination to use mutual authentication to connect.
CRUD Operation Processing
- CRUD operation header attribute
- The destination
looks for the CRUD operation in the
sdc.operation.type
record header attribute. - Operation stage properties
- If there is no CRUD operation in the
sdc.operation.type
record header attribute, the destination uses the operation configured in the Default Operation property.
Hard Deleting Records
When you use the Salesforce Bulk API to delete records, the records move to the Salesforce Recycle Bin, by default. They remain in the Recycle Bin for 15 days. During that time, you can restore those records. After 15 days, the records are purged from the Recycle Bin and can no longer be restored.
You can configure the Salesforce destination to bypass the Salesforce Recycle Bin and permanently delete records that are flagged for deletion. You might hard delete records to recover storage space.
To bypass the Salesforce Recycle Bin and permanently delete records, select the Hard Delete Records property on the Salesforce tab.
Field Mappings
When you configure the Salesforce destination, you can override the default mapping of case-sensitive field names by mapping specific fields in the record to existing fields in the Salesforce object.
- SDC Field - Name of the field in the record that contains the data to be written.
- Salesforce Field - API name of the existing field in the Salesforce object that receives the data. Enter a field name or enter an expression that defines the field.
- Delete or undelete
- To delete or undelete data, map only the Salesforce record Id to delete or
undelete. Create a single field mapping that maps the field in the record
that contains the value of the Salesforce record Id to the Salesforce field
named “Id”. Note: Undelete is not supported by the Salesforce Bulk API.
- Insert, update, or upsert
- To insert, update, or upsert data, you can create multiple field
mappings. When you define the Salesforce fields, use the field name syntax
required by the configured API type:
- Bulk API - Use a colon (:) or period (.) as a field separator. For
example,
Parent__r:External_Id__c
orParent__r.External_Id__c
are both valid Salesforce fields. - SOAP API - Use a period (.) as a field separator. For example,
Parent__r.External_Id__c
is a valid Salesforce field.
- Bulk API - Use a colon (:) or period (.) as a field separator. For
example,
<ObjectType>:<RelationshipName>.<IndexedFieldName>
.
Because a polymorphic field can have more than one type of object as a parent, you must
define the parent object type in the field name syntax. For example, a case field can
have either a user or a queue as the parent. To set a case owner to a user through their
username, specify the User:Owner.Username
Salesforce field.Changing the API Version
Data Collector ships with version 57.0.0 of the Salesforce Web Services Connector libraries. You can use a different Salesforce API version if you need to access functionality not present in version 57.0.0.