2

I am using simple_salesforce and get all records of a custom object called "SER__Condition__c". I know for a fact that that is the name because I got a list of table names from our administrator.
"api" is an instance of "simple_salesforce.Salesforce".
This is the command I'm executing:

pprint(api.query('SELECT Id FROM SER__Condition__c'))

Which returns this error:

  File "path\to\lib\simple_salesforce\api.py", line 698, in _exception_handler
    raise exc_cls(result.url, result.status_code, name, response_content)
simple_salesforce.api.SalesforceMalformedRequest: Malformed request https://xxx.salesforce.com/services/data/v29.0/query/?q=SELECT+Id+FROM+SER__Condition__c. Response content: [{'message': "\nSELECT Id FROM SER__Condition__c\n
       ^\nERROR at Row:1:Column:16\nsObject type 'SER__Condition__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.", 'errorCode': 'INVALID_TYPE'}]

Using the exact same command for a default object returns all the records as expected:

pprint(api.query('SELECT Id FROM Account'))

The same also holds true for these two:

api.Account.get('xxxxxxxxxxxxxxxxxx')
api.SER__Condition__c.get('xxxxxxxxxxxxxxxx')
davejagoda
  • 2,420
  • 1
  • 20
  • 27
Matthias Schreiber
  • 2,347
  • 1
  • 13
  • 20

2 Answers2

4

It probably is a permissions issue. Make sure the SER__Condition__c object is visible to the user you are running the query as.

Pedro Dal Col
  • 231
  • 1
  • 3
0

Yes, I resolved this issue by editing the user profile's custom object permissions. It looks like it defaults to none.

Scott
  • 102
  • 7