rforce
rforce copied to clipboard
Destination URL not reset. The URL returned from login must be set in the SforceService
I was trying to authenticate with oauth through rforce gem and i am getting this exception. I faced this same issue few months back later https://github.com/undees/rforce/issues/27. Facing the same.
Hi, Karthick.
I'm sorry to hear this problem has happened again. Is your project Gemfile set to use RForce version 0.13 (or the latest code from the master branch)? I'm not able to re-create the error when I try the following example with the latest RForce code from Git master:
oauth = {
:consumer_key => '...',
:consumer_secret => '...',
:access_token => '...',
:access_secret => '...',
:login_url => 'https://login.salesforce.com/services/OAuth/u/20.0'
}
binding = RForce::Binding.new \
'https://www.salesforce.com/services/Soap/u/20.0',
nil,
oauth
binding.login_with_oauth
answer = binding.search \
:searchString =>
'find {Example Company Name} in name fields returning account(id)'
account = answer.searchResponse.result.searchRecords.record
account_id = account.Id
p account_id