如何使用restforce gem在rails上的ruby中使用salesforce帐户对象获取所有关联数据

我正在尝试使用restforce REST Api从salesforce获取所有用户数据。我有salesforce帐户对象。 现在我想用这个帐户对象获取所有相关数据。

这是一个多步骤的过程:

  1. 获取对象的列:

    # get the describe for the Account object account_columns = client.describe('Account') # => { ... } 
  2. 运行普通查询:

     accounts = client.query("select #{account_columns} from Account where Id = 'someid'") # => # account = accounts.first # => # 
  3. 访问相关对象:

     account.Owner 

来源 – https://github.com/ejholmes/restforce