Search code examples
salesforcemuleupsert

Mule 4- SalesForce connector - How to specify externalIdFieldName in Create Job Bulk V2 operation


I'm using the following:

  • Mule 4.1.
  • SalesForce api version 41
  • Latest SalesForce connector for Mule
  • Using the SalesForce connector's Create job bulk v 2 operation in a flow.

In a new Mule flow, when I use the Create job bulk v 2 operation with an upsert operation, I don't have the option to specify the externalIdFieldName.

But when I run the flow I get the message:

Invalid status code: 400, response body: "errorCode":"INVALIDJOB",
"message":"InvalidJob : External ID was blank for <Sobject type>. 
An External ID must be specified for upsert."

I'm trying to use the Bulk v2 api because it seems much simpler (don't have to worry about manually splitting the file into smaller chunks etc).

I know that the old way of doing it, via the Upsert bulk operation, has an option for ExternalIdFieldName, but that would mean implementing several extra batch processing steps, so I want to avoid it if possible.

Probably I am missing something about how to insert this value into the message/payload/attributes.

Here is what the Create job bulk v2 screen looks like: Anypoint Studio screenshot

Here is what the Upsert bulk screen looks like: Anypoint studio screenshot


Solution

  • What version of the Salesforce module are you using? See screenshot for reference.

    To force a version update, open your project's pom.xml and edit the version manually.

        <dependency>
            <groupId>com.mulesoft.connectors</groupId>
            <artifactId>mule-salesforce-connector</artifactId>
            <version>9.4.8</version>
            <classifier>mule-plugin</classifier>
        </dependency>
    

    Latest version is 9.5.0 source