无法找到SalesForce对象

时间:2015-06-19 20:22:53

标签: python database salesforce

我在使用SalesForce时遇到了一些麻烦,我之前从未使用过它,因此我不能完全确定这里出了什么问题。我正在使用simple_salesforce python模块。我已成功从SalesForce标准对象中提取数据,但此自定义对象给我带来了麻烦。我的问题是

result = sf.query("Select Name from Call_Records__c")

产生此错误:

Traceback (most recent call last):
  File "simple.py", line 15, in <module>
    result = sf.query("Select Name from Call_Records__c")
  File "/usr/local/lib/python2.7/dist-packages/simple_salesforce/api.py", line 276, in query
    _exception_handler(result)
  File "/usr/local/lib/python2.7/dist-packages/simple_salesforce/api.py", line 634, in _exception_handler
    raise exc_cls(result.url, result.status_code, name, response_content)
simple_salesforce.api.SalesforceMalformedRequest: Malformed request https://sandbox.company.com/services/data/v29.0/query/?q=Select+Name+from+Call_Records__c. Response content: [{u'errorCode': u'INVALID_TYPE', u'message': u"\nSelect Name from Call_Records__c\n                 ^\nERROR at Row:1:Column:18\nsObject type 'Call_Records__c' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name. 
Please reference your WSDL or the describe call for the appropriate names."}]

我已经使用__c对表名和字段名进行了尝试,但仍无法解决这个问题。有什么明显的错误吗?

2 个答案:

答案 0 :(得分:1)

确保您的结果是Call_Records__c / CallRecords__c

Call_Records__c result = sf.query(“从Call_Records__c中选择名字”)  要么 CallRecords__c result = sf.query(“从CallRecords__c中选择姓名”)

答案 1 :(得分:0)

尝试使用 -

result = sf.query("Select Name from CallRecords__c")