- Home
- Technical Library
- Boards
- Cookbook
- Code Share
- Blogs
- Partners
-
More
-
Services
- Training & Certification
- Support
-
Galleries
- Force.com Sites Gallery
- Chatter Challenge Entries
-
Other Web Sites
- Salesforce.com
- Database.com
- AppExchange
- CRM Community
-
Discussions
- Announcements
- General Development
- Schema Development
- New to Cloud Development
- Apex Code Development
- Visualforce Development
- Formulas & Validation Rules Discussion
- Security
- Mobile
- Force.com Sites
- Chatter Development
- Java Development
- .NET Development
- Perl, PHP, Python & Ruby Development
- Adobe Flash Builder for Force.com
- Desktop Integration
- REST API Integration
- Streaming API
- Visual Workflow
- Apple, Mac and OS X
- VB and Office Development
- Excel Connector
- AJAX Toolkit & S-controls
- Force.com Builder & Native Apps
- AppExchange Directory & Packaging
- Force.com Labs Projects
- Open Source
- Site.com
- Jobs Board - Administrators
- Jobs Board - Developers
- Force.com Discussion Boards
- :
- Developer Boards for Force.com and Database.com
- :
- Perl, PHP, Python & Ruby Development
- :
- asf-soap-adapter issue with Ruby On Rails 3.0.3
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
asf-soap-a dapter issue with Ruby On Rails 3.0.3
[ Edited ]
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-01-2011 10:31 AM - last edited on 02-01-2011 12:18 PM
Content of database.yml (with proper credentials erased)
development:
adapter: activesalesforce
url: https://www.salesforce.com
username: ######
password: ######
api_version: 20.0
test:
adapter: activesalesforce
url: https://www.salesforce.com
username: #####
password: #####
api_version: 20.0
production:
adapter: activesalesforce
url: https://www.salesforce.com
username: #####
password: #####
api_version: 20.0
salesforce-default-realm:
adapter: activesalesforce
url: https://www.salesforce.com
username: #####
password: #####
api_version: 20.0Then content of the gemfile file
... gem 'rails', '3.0.3' gem 'asf-soap-adapter', :require =>'activerecord-activesalesforce-adapter' # Bundle edge Rails instead: # gem 'rails', :git => 'git://github.com/rails/rails.git' gem 'sqlite3-ruby', :require => 'sqlite3' ....Runned a bundle install against this file, then a
rails generate model Salesforce::Contactto get access to a standard SFDC object
When I try to use the console : rails console Everything load fine, no error and then when I type
Salesforce::Contact.firstAfter few seconds I get this error. Any clue ?
irb(main):015:0> Salesforce::Contact.first ActiveSalesforce::ASFError: INVALID_TYPE: sObject type 'SalesforceContact__c' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name. Please reference your WSDL or the describe call for the appropriate names. from /usr/local/lib/ruby/gems/1.9.1/gems/asf-soap-adaptTried also with a custom object called Test1, generated also the model and I get thiser-1.1.0/lib/active_record/connection_adapters/act ivesalesforce_adapter.rb:665:in `get_result' from /usr/local/lib/ruby/gems/1.9.1/gems/asf-soap-adapt er-1.1.0/lib/active_record/connection_adapters/act ivesalesforce_adapter.rb:713:in `rescue in get_entity_def' from /usr/local/lib/ruby/gems/1.9.1/gems/asf-soap-adapt er-1.1.0/lib/active_record/connection_adapters/act ivesalesforce_adapter.rb:706:in `get_entity_def' from /usr/local/lib/ruby/gems/1.9.1/gems/asf-soap-adapt er-1.1.0/lib/active_record/connection_adapters/act ivesalesforce_adapter.rb:868:in `lookup' from /usr/local/lib/ruby/gems/1.9.1/gems/asf-soap-adapt er-1.1.0/lib/active_record/connection_adapters/act ivesalesforce_adapter.rb:329:in `select_all' from /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3 .0.3/lib/active_record/base.rb:467:in `find_by_sql' from /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3 .0.3/lib/active_record/relation.rb:64:in `to_a' from /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3 .0.3/lib/active_record/relation/finder_methods.rb: 333:in `find_first' from /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3 .0.3/lib/active_record/relation/finder_methods.rb: 122:in `first' from /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3 .0.3/lib/active_record/base.rb:439:in `first' from (irb):15 from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.3 /lib/rails/commands/console.rb:44:in `start' from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.3 /lib/rails/commands/console.rb:8:in `start' from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.3 /lib/rails/commands.rb:23:in `<top (required)>' from script/rails:6:in `require' from script/rails:6:in `<main>'
irb(main):016:0> Salesforce::Test1.first ActiveSalesforce::ASFError: MALFORMED_QUERY: \nSELECT Test1__c.* FROM Test1__c LIMIT 1\n ^\nERROR at Row:1:Column:17\nunexpected token: '*' from /usr/local/lib/ruby/gems/1.9.1/gems/asf-soap-adaptThanks in advanceer-1.1.0/lib/active_record/connection_adapters/act ivesalesforce_adapter.rb:665:in `get_result' from /usr/local/lib/ruby/gems/1.9.1/gems/asf-soap-adapt er-1.1.0/lib/active_record/connection_adapters/act ivesalesforce_adapter.rb:384:in `select_all' from /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3 .0.3/lib/active_record/base.rb:467:in `find_by_sql' from /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3 .0.3/lib/active_record/relation.rb:64:in `to_a' from /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3 .0.3/lib/active_record/relation/finder_methods.rb: 333:in `find_first' from /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3 .0.3/lib/active_record/relation/finder_methods.rb: 122:in `first' from /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3 .0.3/lib/active_record/base.rb:439:in `first' from (irb):16 from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.3 /lib/rails/commands/console.rb:44:in `start' from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.3 /lib/rails/commands/console.rb:8:in `start' from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.3 /lib/rails/commands.rb:23:in `<top (required)>' from script/rails:6:in `require' from script/rails:6:in `<main>'
For information here is the list of gems when I try to list them, what is weird is that I can't see the activerecord-activesalesforce-adapter gem even though it is listed in the Gemfile
Using rake (0.8.7) Using abstract (1.0.0) Using activesupport (3.0.3) Using builder (2.1.2) Using i18n (0.5.0) Using activemodel (3.0.3) Using erubis (2.6.6) Using rack (1.2.1) Using rack-mount (0.6.13) Using rack-test (0.5.7) Using tzinfo (0.3.24) Using actionpack (3.0.3) Using mime-types (1.16) Using polyglot (0.3.1) Using treetop (1.4.9) Using mail (2.2.15) Using actionmailer (3.0.3) Using arel (2.0.7) Using activerecord (3.0.3) Using activeresource (3.0.3) Using facets (2.8.4) Using hpricot (0.8.3) Using oauth (0.4.4) Using rforce (0.6) Using asf-soap-adapter (1.1.0) Using bundler (1.0.10) Using thor (0.14.6) Using railties (3.0.3) Using rails (3.0.3) Using sqlite3 (1.3.3) Using sqlite3-ruby (1.3.3)
Re: asf-soap-a dapter issue with Ruby On Rails 3.0.3
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-01-2011 03:22 PM
First quick point, the current adapter was written for rails 2.3.x, but, in theory, it should work for v3.
Looking at your snippet, you are trying to generate a model on an existing Salesforce object, which is basically trying to create a custom object, thus the __c suffix.
Long story short, you don't need to generate models for standard objects. eg: something like the following will work just fine from the console:
>> Salesforce::Contact.first
Creating custom objects should work fine:
script/generate model Salesforce::CustomObject
Just remember you dont need to add the __c as the adapter will take care of it.
HTH
Salesforce Developer Evangelist
twitter: @quintonwall
Re: asf-soap-a dapter issue with Ruby On Rails 3.0.3
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-02-2011 02:09 AM
Thanks for your answer, but unfortunately it doesn't seem to work with Rails 3, I have rebuild an entire project using the same configuration files and gemfile In the console I get this (didn't generate any model)
irb(main): Salesforce::Contact.first
NameError: uninitialized constant Salesforce
from (irb):1
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.3
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.3
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.3
from script/rails:6:in `require' from script/rails:6:in `'
Re: asf-soap-a dapter issue with Ruby On Rails 3.0.3
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-02-2011 09:37 AM
I'll try and get some time today to build a project in Rails 3 and confirm, but the toolkit was build for v2.3.x. I'll give it a whirl.
FYI I am working on the toolkit specs for Rails 3 today :)
Salesforce Developer Evangelist
twitter: @quintonwall
Re: asf-soap-a dapter issue with Ruby On Rails 3.0.3
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-02-2011 11:32 AM
Sorry, I forgot to add that you could always use the REST API to connect pretty easily now.
See http://developer.force.com/cookbook/recipe/interac
Salesforce Developer Evangelist
twitter: @quintonwall
Re: asf-soap-a dapter issue with Ruby On Rails 3.0.3
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-02-2011 01:37 PM
Thanks Cloud for your answer, please keep me updated on this.
Started also to investigate the REST API, but... it is pretty verbose compared to the asf-soap-adapter.
Re: asf-soap-a dapter issue with Ruby On Rails 3.0.3
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-02-2011 01:48 PM
yepper. stay tuned on the update to the toolkit.
Salesforce Developer Evangelist
twitter: @quintonwall
Re: asf-soap-a dapter issue with Ruby On Rails 3.0.3
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-15-2011 01:36 PM
Quinton, what ever happened to the creation of a Rails 3.0.3 (or 3.0.4) with the forcedotcom and asf-soap-adapter gems?
Re: asf-soap-a dapter issue with Ruby On Rails 3.0.3
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-15-2011 01:41 PM
Good timing. I am actually writing some info about it as we speak to make sure we gather the correct requirements. I have also been working with the Heroku folks to ensure we leverage their experience too. Writing the toolkit is certainly very high on my todo list.
One thing to note is that the toolkit will use REST and move away from the active-record model.
Best I can add right now re ETA is as soon as I can. I know it is very important to the Ruby community, but we want to do it right
Salesforce Developer Evangelist
twitter: @quintonwall
Re: asf-soap-a dapter issue with Ruby On Rails 3.0.3
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-17-2011 10:32 AM
You said all the magic words. Thanks for your efforts behind Rails/Salesforce integration.
However, my question remains: is there no working toolkit (gem) for Rails 3.x integration with SF?
For other readers, here's another relevant forum thread.

