SalesforceFsdb

Salesforce SObject system to retrieve and cache SObjects.

Installation

Gem Installation

Download and install salesforce_fsdb with the following:

gem install salesforce_fsdb

Usage

require 'salesforce_fsdb/client'

paramsGeneral    =  {
  :api_fqdn      => 'na1.salesforce.com',
  :api_version   => '29.0',
  :data_dir      => '/path/to/sf_data',
  :max_age       => 60*60*24*7
}

paramsToken      =  {
  :grant_type    => 'password',
  :client_id     => 'my_client_id',
  :client_secret => 'my_client_secret',
  :username      => 'my_username',
  :password      => 'my_password'
}

# using the filesystem cache with max_age
sfFsdbClient = SalesforceFsdb::Client.new(paramsGeneral,paramsToken)
sObjectHash  = sfFsdbClient.getSobjectForSfidAndType('my_sobject_id','Account')

# without using a filesystem cache
sfRestClient = SalesforceFsdb::RestClient.new(paramsGeneral,paramsToken)
sObjectHash  = sfRestClient.getSobjectForSfidAndType('my_sobject_id','Account')

Notes

Object Size

Some large Salesforce Objects may generate Salesforce errors. A future release will allow specifying specific fields for retrieval.

Salesforce REST API Reference

www.salesforce.com/us/developer/docs/api_rest/

Problems, Comments, Suggestions?

All of the above are most welcome. [email protected]

Credits

John Wang - johnwang.com

License

SalesforceFsdb is available under an MIT-style license.

:include: MIT-LICENSE

Warranty

This software is provided “as is” and without any express or implied warranties, including, without limitation, the implied warranties of merchantibility and fitness for a particular purpose.