Contact Us 1-800-596-4880

Salesforce Connector 10.10 Additional Configuration Information - Mule 4

Configure Anypoint Connector for Salesforce (Salesforce Connector) to:

  • Load data in batches

  • Specify a Lead ID for a Lead Convert Request operation

  • Update field values to null

  • Generate an OAuth 2.0 keystore file

Load Data in Batches

The Salesforce Bulk API loads batches of your organization’s data into Salesforce. Salesforce Connector provides the Create and Create Bulk operations for working with the Bulk API.

For all bulk operations, Salesforce handles the creation process in the background. The connector replies with a BatchInfo object, which contains the ID of the batch and the ID of the job it creates to upload the batched objects.

In Salesforce, you can track the status of bulk data load jobs and their associated batches by using the job ID for Bulk Data Load Jobs:

  1. Click <YOUR_NAME > Setup > Monitoring > Bulk Data Load Jobs.

  2. Click the job ID to view the job detail page.

The job detail page includes a list of all the batches related to the job. The list provides View Request and View Response links for each batch. If the batch is a CSV file, the links return the request or response in CSV format. If the batch is an XML file, the links return the request or response in XML format.

Specify a Lead Convert Request ID

To specify a lead ID for a LeadConvertRequest operation, use a DataWeave transform message. When you use a transform message before the operation, you must add the leadId field, because the metadata for the operation doesn’t specify it:

<ee:transform doc:name="Transform Message" >
            <ee:message >
                <ee:set-payload ><![CDATA[%dw 2.0
output application/java
---
{
    leadId: "LEAD_ID",
    accountId: "ACCOUNT_ID",
    convertedStatus: "Closed - Converted",
    doNotCreateOpportunity: true
} as Object {
    class : "org.mule.extension.salesforce.api.core.LeadConvertRequest"
}]]></ee:set-payload>
            </ee:message>
</ee:transform>

Update Field Values to Null

To set field values to null, use an Update or Upsert request operation and insert the names of the fields you want to nullify in the Transform Message component’s fieldsToNull field:

Set a field to null
Figure 1. Specify the field names you want to nullify in the Transform Message component fieldsToNull field.

Generate a Keystore File

Salesforce Connector uses the Bouncy Castle cryptographic library to load the certificate from the keystore and sign the payload for the authentication requests.

The library has a vulnerability (CVE-2018-5382) that relates to the BKS-V1 keystore file type. By default, Salesforce Connector uses JKS or PKCS12 keystores. Avoid using BKS-V1 keystore files, as documented in the Bouncy Castle proposed solution.

To generate a JKS keystore file:

  1. Go to your Mule workspace and open the command prompt (for Windows) or Terminal (for Mac).

  2. Enter this command:

    keytool -genkeypair -alias salesforce-cert -keyalg RSA -keystore salesforce-cert.jks
  3. Enter the following information:

    • Password for the keystore

    • Your first name and last name

    • Your organization unit

    • Your city and state, and the two-letter code for your country

      The system generates a Java keystore file (JKS format) that contains a private or public key pair in your workspace.

  4. Provide the file path for the keystore in your connector configuration.

    Enter this command:

    keytool -exportcert -alias salesforce-cert -file salesforce-cert.crt -keystore salesforce-cert.jks

    The system exports the public key from the keystore into the workspace. This is the public key to enter in your Salesforce instance.

  5. Verify that you have both the keystore (salesforce-cert.jks) and the public key (salesforce-cert.crt) files in your workspace.

View on GitHub