3

I have an object of type Contact with an External ID field called my_external_id_field

when i call: https://instance/services/data/v41.0/sobjects/Contact/my_external_id_field/012443

with a patch method (if i use post it complains it's not allowed) with a .json file, i get the error:

"The my_external_id_field field should not be specified in the sobject data"`, "errorCode:INVALID_FIELD"

What could be the reason?

I just want SF to check if a record with this id of 012443 exists. If so, update it with the sent .json, if not - create it with the sent .json.

1 Answer 1

3

You must not put the external ID field/value in the JSON; it is specified by the URL you're hitting. Simply remove that bit from your file and it should work.

Here's an example using Accounts:

PATCH /services/data/v41.0/sobjects/Account/External_Id__c/12345
...

{ "Name": "Test Account A", "Industry": "Technology" }

When this transaction completes, External_Id__c will be set to 12345.


External ID Upsert In Developer Workbench

1
  • 1
    Thanks, appreciate all of your help today and yesterday! Jan 17, 2018 at 20:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .