简体   繁体   English

如何使用python从salesforce查询OpportunityFieldHistory

[英]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.

相关问题 如何从github安装salesforce python库 - How to install the salesforce python library from github 如何使用 Python 从 Salesforce 获取文件 - How to get files from Salesforce using Python 如何将从 salesforce 中提取的表格式化为 python? - How to format a table extracted from salesforce into python? 如何使用Beatbox python API从Salesforce中提取原始数据 - How to extract raw data from Salesforce using Beatbox python API 使用简单的 salesforce (python) 在 SFDC 中查询 SOQL - SOQL query in SFDC using simple salesforce (python) python simple_salesforce查询全部 - python simple_salesforce query all 如何使用来自 OAuth autherization 的用户的 Salesforce 访问令牌通过 CData ODBC 驱动程序使用 python 访问 Salesforce 数据? - How to access Salesforce data through CData ODBC driver using python with using Salesforce Access Token of the user from OAuth autherization? simple_salesforce python中的父子关系查询,从有序字典中提取 - parent-child relationship query in simple_salesforce python, extracting from ordered dicts 如何在 Salesforce (SOQL) 中执行 JOIN - 简单的 Salesforce(Python 库) - How to perform a JOIN in Salesforce (SOQL) - Simple Salesforce (Python Library) 使用Python从Salesforce URL下载图像 - Downloading images from Salesforce URL using Python
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM