Skip to content

Instantly share code, notes, and snippets.

@endymion
Created July 29, 2014 22:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save endymion/d5acf44be284d4feeda2 to your computer and use it in GitHub Desktop.
Save endymion/d5acf44be284d4feeda2 to your computer and use it in GitHub Desktop.
Merge Salesforce objects using Ruby SOAP API code
require 'soapforce'
request = <<"EOC"
<request>
<masterRecord>
<ns7:type xmlns:ns7="urn:sobject.partner.soap.sforce.com">Lead</ns7:type>
<ns8:Id xmlns:ns8="urn:sobject.partner.soap.sforce.com">00Qo0000002gZlTEAU</ns8:Id>
</masterRecord>
<recordToMergeIds>00Qo0000002gZldEAE</recordToMergeIds>
</request>
EOC
client = Soapforce::Client.new
client.authenticate(:username => '[redacted]', :password => '[redacted]')
client.merge(request)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment