简体   繁体   中英

How to get all associated data with the salesforce account object in ruby on rails using restforce gem

I am trying to fetch all the user data from the salesforce using restforce REST Api.I have salesforce account object. Now i would like to get all associated data with this account object.

This is a multi-step process:

  1. Get the columns for the object:

     # get the describe for the Account object account_columns = client.describe('Account') # => { ... } 
  2. Run a normal query:

     accounts = client.query("select #{account_columns} from Account where Id = 'someid'") # => #<Restforce::Collection> account = accounts.first # => #<Restforce::SObject> 
  3. Access related objects:

     account.Owner 

Source - https://github.com/ejholmes/restforce

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM