[英]How to Query from salesforce the OpportunityFieldHistory with python
I am having an issue figuring out how to start a query on the OpportunityFieldHistory from Salesforce. 我有一个问题,想知道如何从Salesforce开始对OpportunityFieldHistory进行查询。
The code I usually use and works for querying Opportunty or Leads work fine, but I do not know how should be written for the FieldHistory. 我通常使用的代码用于查询Opportununty或Leads工作正常,但我不知道应该如何为FieldHistory编写代码。
When I want to query the opportunity or Lead I use the following: 当我想查询机会或Lead时,我使用以下内容:
oppty1 = sf.opportunity.get('00658000002vFo3')
lead1 = sf.lead.get('00658000002vFo3')
and then do the proper query code with the access codes... 然后使用访问代码执行正确的查询代码...
The problem arises when I want to do the analysis on the OpportunityFieldHistory, I tried the following: 当我想对OpportunityFieldHistory进行分析时出现问题,我尝试了以下方法:
opptyhist = sf.opportunityfieldhistory.get('xxx')
Guess what, does not work. 猜猜什么,不起作用。 Do you have any clue on what should I write between sf.
你对我应该在sf之间写什么有任何线索吗? and .get?
和.get?
Thanks in advance 提前致谢
Looking at the simple-salesforce API , it appears that the get
method accepts an ID which you are passing correctly. 查看simple-salesforce API ,看起来
get
方法接受正确传递的ID。 However, a quick search in the Salesforce API reference seems to indicate that the OpportunityFieldHistory may need to be obtained by another function such as get_by_custom_id(self, custom_id_field, custom_id)
. 但是,在Salesforce API参考中快速搜索似乎表明OpportunityFieldHistory可能需要由另一个函数获取,例如
get_by_custom_id(self, custom_id_field, custom_id)
。
(OpportunityFieldHistory){ Id = None CreatedDate = 2012-08-27 12:00:03 Field = "StageName" NewValue = "3.0 - Presentation & Demo" OldValue = "2.0 - Qualification & Discovery" OpportunityId = "0067000000RFCDkAAP" },
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.