• terryroe
  • NEWBIE
  • 5 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 2
    Replies

I'm hoping someone will respond.  So far, I've had no luck on any of my other posts getting someone to respond.

 

Goal:  Query all records of a custom object type from Rails.

 

Approaches tried and results:

 

asf-soap-adapter gem:  doesn't support underscores in object names

asf-rest-adapter gem:  (don't recall why, but this didn't work either)

databasedotcom gem:  .all() method only returns 250 records and there are nearly 900 in Salesforce

salesforce bulk api:  tried several gems that purport to be bulk api gems.  received various errors with every one of them.

 

Question 1:  Is the bulk api the proper approach here, or should the normal REST api work?  Is there any way to make the databasedotcom gem work in this situation?

 

Question 2:  If the bulk api is the proper approach, is there an official gem that should be used?  I tried them all, including the one referenced in the Salesforce documentation, without success.

 

Hoping that someone will read this and provide some direction.

 

TR

I am trying to add the asf-rest-adapter to a Rails 2.3.11 app which is currently using the asf-soap-adapter.  I am new to Salesforce and to the project I'm working on, and haven't used these gems before.  However, the SOAP adapter is working fine and I can connect to Salesforce via the console.

 

Here's the problem.  When I start the console with asf-soap-adapter included in the project, I get: NoMethodError: undefined method 'schema' for Salesforce::Rest::Account:Class.  Apparently, that's the first Salesforce object that's being loaded.

 

I have ActiveResource 2.3.11 installed.  I found a google groups posting about this very issue, but there was no resolution posted.

 

I have yet to find any coherent steps to getting the asf-rest-adapter setup and working.  It is apparently assumed (in the github project README, and elsewhere) that you know all about the SOAP adapter, Salesforce REST Api, etc.  If such documentation or how to guides exist, I would greatly appreciate a pointer to them.

 

TIA for any help.

 

TR

I'm hoping someone will respond.  So far, I've had no luck on any of my other posts getting someone to respond.

 

Goal:  Query all records of a custom object type from Rails.

 

Approaches tried and results:

 

asf-soap-adapter gem:  doesn't support underscores in object names

asf-rest-adapter gem:  (don't recall why, but this didn't work either)

databasedotcom gem:  .all() method only returns 250 records and there are nearly 900 in Salesforce

salesforce bulk api:  tried several gems that purport to be bulk api gems.  received various errors with every one of them.

 

Question 1:  Is the bulk api the proper approach here, or should the normal REST api work?  Is there any way to make the databasedotcom gem work in this situation?

 

Question 2:  If the bulk api is the proper approach, is there an official gem that should be used?  I tried them all, including the one referenced in the Salesforce documentation, without success.

 

Hoping that someone will read this and provide some direction.

 

TR

I'm hoping someone will respond.  So far, I've had no luck on any of my other posts getting someone to respond.

 

Goal:  Query all records of a custom object type from Rails.

 

Approaches tried and results:

 

asf-soap-adapter gem:  doesn't support underscores in object names

asf-rest-adapter gem:  (don't recall why, but this didn't work either)

databasedotcom gem:  .all() method only returns 250 records and there are nearly 900 in Salesforce

salesforce bulk api:  tried several gems that purport to be bulk api gems.  received various errors with every one of them.

 

Question 1:  Is the bulk api the proper approach here, or should the normal REST api work?  Is there any way to make the databasedotcom gem work in this situation?

 

Question 2:  If the bulk api is the proper approach, is there an official gem that should be used?  I tried them all, including the one referenced in the Salesforce documentation, without success.

 

Hoping that someone will read this and provide some direction.

 

TR

The activesalesforce plugin severely limits the names you are allowed to give to your custom classes. You cannot have any underscores in the API name for your custom object. So a name like "Core_Product" must be renamed to "CoreProduct", otherwise activesalesforce has a fit.

This class:


class SfCoreProduct < ActiveRecord::Base

set_table_name "Core_Product__c"
set_primary_key "id"
establish_connection "salesforce"

end


produces this error:


INVALID_TYPE: sObject type 'CoreProduct_c__c' is not supported


Setting the Salesforce object to "CoreProduct", and changing the "SfCoreProduct" class to the following code works.


class SfCoreProduct < ActiveRecord::Base

set_table_name "CoreProduct"
set_primary_key "id"
establish_connection "salesforce"

end


I have developed several S-Control's in the past using Javascript and Flex, and neither of those connectors changed the salesforce custom object names specified. I have two options:

1. Remove underscores from all of custom objects and the S-Controls that use them.
2. Hack activesalesforce to use the table name specified in "set_table_name".

Neither of these seem to appealing