1

How do i add multiple records in a single api call via the bulk api using the databasedotcom gem ? right now i using the normal activerecord type methods to insert which takes one api call per record

Bill the Lizard
  • 398,270
  • 210
  • 566
  • 880
yatish mehta
  • 905
  • 1
  • 10
  • 25
  • bulkAPI is well documented (http://www.salesforce.com/us/developer/docs/api_asynch/), are you having some problems with it? – mmix Feb 15 '12 at 11:19

4 Answers4

5

The databasedotcom gem does not support bulk API as it is just a wrapper for the SFDC REST API Check here: https://github.com/heroku/databasedotcom/issues/50

You will have to implement Bulk API on your own, I could not find any ruby gem for it. Here is the reference http://www.salesforce.com/us/developer/docs/api_asynch/

Nilesh
  • 1,149
  • 9
  • 14
1

you can look at rforce gem. Here is an example of inserting multiple records.

Community
  • 1
  • 1
Bhushan Lodha
  • 6,824
  • 7
  • 62
  • 100
0

I just came across the salesforce_bulk gem that is used for Bulk API calls. Here is an article on how to use it: http://wiki.developerforce.com/page/Accessing_Salesforce_Data_From_Ruby

mwaugh
  • 36
  • 1
  • salesforce_bulk gem is not updated and compulsory uses usoername password combo for authentication. Instead i have re written the same gem which uses all authentication method with governor limits.https://github.com/yatishmehta27/salesforce_bulk_api – yatish mehta Apr 13 '12 at 08:40
0

Get records from SFDC.

  1. rails generate scaffold_controller Account Name:String

  2. Gemfile
    gem "databasedotcom"
    gem "databasedotcom-rails"

  3. create databasedotcom.yml
    //Create remote access in SFDC
    client_id:
    client_secret:
    username:
    password:
    host: login.salesforce.com debugging: true  version: 25.0

  4. delete public/index.html

  5. routes.rb
    root :to "accounts#index"
    resources :accounts

  6. controllers/accounts_controller.rb include Databasedotcom::Rails::Controller

    change "account.destroy" to "account.delete"

    create @account['OwnerId'] = '00590000000pQOL' (required field)

  7. Remove .error in views/_form.html.erb

BruceYue
  • 281
  • 3
  • 6
  • It s doesnt use the bulk api .. hence using Databasedotcom gem will finish ur governor limits – yatish mehta Sep 03 '12 at 14:21
  • Can this be formatted (e.g. with sample code) and fleshed out a little? That would make it more useful to people who find this question via search, if it's actually effective. – pjmorse Sep 23 '12 at 00:33