04-27-2018 09:41 AM
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:
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”
I bet I am missing something simple. Can anyone chime in what that might be?
06-06-2018 08:50 PM
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:
11-15-2022 01:56 PM
Hi @lzapart,
Do you have an example .slp of the pipeline you can share?
11-16-2022 09:48 AM
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):
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:
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).