cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Salesforce SOAP Merge

lzapart
New Contributor III

Hi,

I am using SOAP snap to connect to Salesforce. I am able to get a session id back. Using the session id, I want to perform a Salesforce SOAP API Merge() call. I am able to generate a merge envelope and using a mapper I feed in a master record and a record to merge:
image

image

But for some reason I keep getting the following error on the merge SOAP step:

โ€œerrorโ€: โ€œMISSING_ARGUMENT: merge called with a batch of 0 ids to merge; must specify at least 1 idโ€

image

I bet I am missing something simple. Can anyone chime in what that might be?

3 REPLIES 3

lzapart
New Contributor III

Ok, figured it out for those interested. I had to generate a XML file for my next Salesforce operation and pass it into the REST Post snap using the server URL:

image

image

image

image

jervin
New Contributor III

Hi @lzapart,
Do you have an example .slp of the pipeline you can share?

lzapart
New Contributor III

Hi, I am attaching a gutted version example:

Salesforce SOAP API Tests_2022_11_16.slp (19.2 KB)

I think the original posts sums up my configuration we still use today.
I think you can use other approaches to accomplish this but weโ€™ve been using this solution for years now successfully for SF Merge requests.

Be warned: Always try and test in DIT/FIT environments.

My SOAP Execute snap is using WSDL file called โ€œSFDC_Ent_wsdl.jsp.xmlโ€ that I generated (and named) out of the Salesforce.com account weโ€™re using. (This step might need elevated admin user in SF.com). It contains things such as the server url (FIT in my example) to be used by the SOAP snap. There is a way to link to the SF.com file thru a url if you like (does not work for me due to security).

The SOAP Exec snap is able, using account user and password, to establish a login. In the SOAP Exec snap there is a button to โ€œcustomize envelopeโ€ that I used to insert my service account credentials (I think today better option to this exists using SL account):

image

image

After successful login we receive a session ID and server url to be used in my XML file and in Rest Post snap steps. The earlier XML example in the past was for using a SOQL, the one below is what I used for merging accounts in Salesforce.com:

image

Note: I had to figure out to include โ€œ<ns0:masterRecord xsi:type=โ€œns1:Accountโ€>โ€ to let SF know what object ids Iโ€™m merging in the XML. It was not part of my generated WSDL file generated for some reason but was required.

Note: You can specify additional attributes in the requests such as โ€œfields to nullโ€ on a merge request, see Salesforce.com documentation.

The shared merge code generates the XML file we use in the final REST Post snap to send all the SF IDs we want to merge in the example above. We have been using a join and group by to generate the XML list with groups of 15 for the POST snap (example below how you can use a group and list to feed into the XML).
image