• John Siedlicki
  • NEWBIE
  • 25 Points
  • Member since 2005

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 12
    Replies
Since a carriage return signifies the end of a record in a csv file, how do you insert a carriage return as data in a field using the Data Loader?  A good example is the Shipping and Billing Street fields in Accounts which allow carriage returns in Salesforce.
 
John
I am creating a Rails app that is called from a custom link in sfdc using SID authentication. The first time the link is clicked it works, each time after it fails giving the following error (abbreviated).
 
ActiveRecord::StatementInvalid
(ActiveRecord::StatementInvalid:
ActiveRecord::ConnectionNotEstablished:
ActiveRecord::ConnectionNotEstablished: Retrieving metadata for ...)
 
If I change over to a hard coded login, using an entry in the database.yml file, it works every time. The error can be easily recreated with this simple rails app.
 
From a command line execute the following:
  1. rails sid_test
  2. cd sid_test
  3. Add require_gem 'activesalesforce' to the environment.rb file
  4. ruby script/generate model Account
  5. ruby script/generate controller Test sid_test
  6. Add this code to the sid_test method of the Test controller (uses SID authentication):
      Account.establish_connection(:adapter => 'activesalesforce',
                                   :sid => params[:sid],
                                   :url => params[:api_server_url])
      account = Account.find(:first)
      render :text => "Name = #{account.name}"
  7. ruby script/server
  8. Create a custom link in sfdc like this one:
    https://mysite.com/test/sid_test?sid={!API.Session_ID}&api_server_url={!API.Enterprise_Server_URL_80}
  9. Click it once, it works, try it again, (boom)!

My assumption is that I must call establish_connection each time I need to connect to sfdc to ensure I am connecting using the proper user's session.

Any one else having these or similar issues with SID authentication?

I am using the latest versions of Rails (1.2.1), ActiveRecord (1.15.1) and ActiveSalesforce (1.1.0).  I can provide more details if it will help.

Thanks,
John

Using Activesalesforce and a Rails application, is there a way to specify that Activesalesforce use the Session ID and Server URL handed through from a custom link or S-Control?
 
I am looking for a seamless authentication transition from salesforce to my custom app as described in:
 
 
The only documentation I have found on establishing an ASF connection is to hard code the username and password in the database.yaml file of a Rails app.
 
Thanks in advance,
John
Since a carriage return signifies the end of a record in a csv file, how do you insert a carriage return as data in a field using the Data Loader?  A good example is the Shipping and Billing Street fields in Accounts which allow carriage returns in Salesforce.
 
John
activesalesforce-1.1.4.gem contains:

- supports the latest version of rails and rubygems
- select count(*) now uses 9.0 api support for native SOQL select count()
- clientId support
- SID authentication connection management bug fixes

NOTE: In your environment.rb you will need to change:

require_gem 'activesalesforce'


to:

require 'activesalesforce'

Message Edited by Doug Chasman on 03-28-2007 01:43 PM

I am creating a Rails app that is called from a custom link in sfdc using SID authentication. The first time the link is clicked it works, each time after it fails giving the following error (abbreviated).
 
ActiveRecord::StatementInvalid
(ActiveRecord::StatementInvalid:
ActiveRecord::ConnectionNotEstablished:
ActiveRecord::ConnectionNotEstablished: Retrieving metadata for ...)
 
If I change over to a hard coded login, using an entry in the database.yml file, it works every time. The error can be easily recreated with this simple rails app.
 
From a command line execute the following:
  1. rails sid_test
  2. cd sid_test
  3. Add require_gem 'activesalesforce' to the environment.rb file
  4. ruby script/generate model Account
  5. ruby script/generate controller Test sid_test
  6. Add this code to the sid_test method of the Test controller (uses SID authentication):
      Account.establish_connection(:adapter => 'activesalesforce',
                                   :sid => params[:sid],
                                   :url => params[:api_server_url])
      account = Account.find(:first)
      render :text => "Name = #{account.name}"
  7. ruby script/server
  8. Create a custom link in sfdc like this one:
    https://mysite.com/test/sid_test?sid={!API.Session_ID}&api_server_url={!API.Enterprise_Server_URL_80}
  9. Click it once, it works, try it again, (boom)!

My assumption is that I must call establish_connection each time I need to connect to sfdc to ensure I am connecting using the proper user's session.

Any one else having these or similar issues with SID authentication?

I am using the latest versions of Rails (1.2.1), ActiveRecord (1.15.1) and ActiveSalesforce (1.1.0).  I can provide more details if it will help.

Thanks,
John

Using Activesalesforce and a Rails application, is there a way to specify that Activesalesforce use the Session ID and Server URL handed through from a custom link or S-Control?
 
I am looking for a seamless authentication transition from salesforce to my custom app as described in:
 
 
The only documentation I have found on establishing an ASF connection is to hard code the username and password in the database.yaml file of a Rails app.
 
Thanks in advance,
John
Hi All,

I've downloaded the sforce_connect_for_pe.xla. Is that not the open source version of Sforce connector because it prompts me for password. Thanks.

Sincerely
Jeremy
  • November 02, 2005
  • Like
  • 0