• Cye
  • 0 Points
  • Member since 2009

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
  • 1
I am trying to build some Ruby utility scripts. Eventual I would like to replicate some basic export and import data scripts like Data Loader as a command line utility. Please stop me now if I am barking up the wrong tree. I am able to generate scaffolding through rails no problem using the scaffold generator(I have heard reference to a asfscaffold but can't find it.) But I would like to dump sObject data to a csv file.

the follow script works and generates a list of objects:

require 'rubygems'
require 'activesalesforce'

:adapter => 'activesalesforce',
:username => '',
:password => '',
:url => 'https://www.salesforce.com' )

sObjects = ActiveRecord::Base.connection.binding.describeGlobal([]).describeGlobalResponse.result.types.sort
puts sObjects

but I can't seem to figure out the syntax to describeSObjects syntax I have:

mySobjects = ['Contact', 'Account']
list = ActiveRecord::Base.connection.binding.describeSObjects(mySobjects).results

which returns nil

Can someone help me with this syntax?

Also an example of a query would be great too.