I'm using the rforce gem to create records in my salesforce database.
The example for creating records in the rforce documentation is:
opportunity = [
:type, 'Opportunity',
:accountId, account_id,
:amount, '10.00',
:name, 'Fakey McFakerson',
:closeDate, '2008-07-04',
:stageName, 'Closed Won'
]
binding.create :sObject => opportunity
The salesforce API call create()
allows for the creation of multiple object at once, but I'm struggling to accomplish this. I've tried the following call:
binding.create :sObject => array_of_opportunities
Where array_of_opportunities
is an array of arrays like opportunity
in the example above.
but that throws an error:
NoMethodError (undefined method `to_sym' for #<Array:0x00000004ba5488>)
I'd appreciate any help.