Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to update a nested sobject using simple_salesforce?

I have been trying to update a nested object using simple_salesforce specifically been trying to update the Owner field in a Case object.

from simple_salesforce import Salesforce
sf = Salesforce(username = 'username',password = 'password',security_token='security_token', sandbox = False)

sf.Case.create({'Description':'stuff in description','Owner':'Owners User'})

Whenever I try to insert I get the following error:

Response content:

[{u'errorCode': u'INVALID_FIELD', u'message': u'The value provided for foreign key reference Owner is not a nested SObject'}]

Please any help would be appreciated.

like image 251
user1445203 Avatar asked Dec 15 '14 09:12

user1445203


1 Answers

I ran into this same error and it turns out you have to use the OwnerId field and pass the Id of the owner.

like image 72
nomadic_squirrel Avatar answered Oct 03 '22 05:10

nomadic_squirrel