Salesforce create service
Salesforce Create Service
The Salesforce Create Service can be used to create one or more new Salesforce records of the specified Salesforce object type.
This component has the option of either using the specified ConnectMessagePart body to create new records or using the headers in a ConnectMessagePart to create a single new record.
So it is possible to create more than one record (up to a limit of 200 records) in a single transaction when using the ConnectMessagePart body. This is important because Salesforce limits the daily number of API calls a client application, such as the ConnectAgent, can request from the Salesforce servers.
In the table below, you will find an explanation of these properties. All attributes with a ‘*’ are mandatory.
Attribute |
Description |
Name* |
By default, we fill this out with the technical ‘tag’, followed by a serial number. Changing the name is optional. |
Enabled |
Set this value to true, if you want this service to be enabled. |
MessagePart In |
The incoming ConnectMessagePart that specifies which Salesforce objects need to be created and with what field data. |
Salesforce Instance |
The Salesforce instance refers to the server your Salesforce organization lives on. It is visible in the first part of the url after you log in to your Salesforce account. Valid examples are eu27, ap5, and na12. |
Key Password |
The password of the key pair in the keystore. If left empty it defaults to the keystore password. |
MessagePart Out |
The outgoing ConnectMessagePart that contains the ID(s) of the created Salesforce object(s). |
Key Alias |
The alias of the key pair in the ConnectPlaza keystore. The private key is used to sign the JWT. A certificate with the public key needs to be registered in Salesforce when a connected app is created. |
All or None | Roll everything back when operating on multiple Salesforce records at once and at least one of the operations fails. |
Client ID | The client ID of the Salesforce connected app. |
Username | The username of the Salesforce account you wish to use to authenticate the Salesforce API calls. |
Use Body |
Get the Salesforce record information from the message body. Alternatively, get this information from the headers. See the documentation for the correct message body format. |
Authentication |
Select the way you wish to authenticate your Salesforce API calls. Note that each authentication method has different requirements. Consult ConnectPlaza's technical documentation for more details. |
Security Token |
The security token of the Salesforce account you wish to use to authenticate the Salesforce API calls. Note that if you do not possess the security token you can request Salesforce to generate a new one. Consult the Salesforce documentation for the details. When Authentication is set to OAUTH2_PASSWORD or SOAP_PASSWORD |
Client Secret |
The client password of the Salesforce connected app. When Authentication is set to OAUTH2_PASSWORD or OAUTH2_REFRESH_TOKEN |
Password |
The password of the Salesforce account you wish to use to authenticate the Salesforce API calls. When Authentication is set to OAUTH2_PASSWORD or SOAP_PASSWORD |
Refresh Token |
The OAuth2 refresh token for the specified connected app. Note that you can set the expiration date of the refresh token in your Salesforce connected app configuration. It is advised to set it to never expire. When Authenticationi s set to OAUTH2_REFRESH_TOKEN |
Salesforce Object Name |
The Salesforce object name. When Use Body is false |
Mapped Headers |
A comma separated list of ConnectMessagePart header names that map to Salesforce object fields. When Use Body is false |
Cache Expiration |
The expiration time in minutes of entries in the cache. The cache is used to store Salesforce object descriptions which are in turn used to format API requests. Note that if this value is small it might result in many redundant API calls. However, if the value is large, changes made to Salesforce object types might take longer to propagate to the cache. Advanced |
Description |
Description of the purpose of this component. This will be part of the documentation printed out in the Diagram of this interface. |
When using the ConnectMessagePart body, we use XML to specify the new records. For example, an incoming ConnectMessagePart might have the following XML body:
<records>
<record type=”Account”>
<field name=”Name” value=”foo”/>
<field name=”Rating” value=”Hot”/>
</record>
<record type=”Account”>
<field name=”Name” value=”bar”/>
<field name=”NumberOfEmployees” value=”42”/>
</record>
</records>
The top-level element is always records when creating multiple records. However, if you create a single record, you can have record as the top-level element. For example, the following would also be valid:
<record type=”Account”>
<field name=”Name” value=”foo”/>
<field name=”Rating” value=”Hot”/>
</record>
The records element can have multiple record subelements. Each record always has a type attribute. Note that you cannot create records of multiple different types in a single batch. So each record must have the same type.
Furthermore, each record has zero or more fields. Each field must have a name and value attribute. It is possible to update different fields in different records in a single transaction as long as the records are of the same type.
After executing the request the service returns the ID(s) of the created record(s) in the body of the outgoing ConnectMessagePart. If there is more than one ID, this will be a comma separated list of IDs.
Finally, see the article on authentication for the different available options as well as their corresponding requirements.