How to update nested sobject using simple_salesforce?

I am trying to update a nested object using simple_salesforce , specifically 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 paste, 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.

+5
source share
1 answer

I encountered the same error, and it turns out that you need to use the OwnerId field and pass the owner ID.

+2
source

Source: https://habr.com/ru/post/1209073/


All Articles