1

I am trying to upsert a record in Salesforce using the REST API.

My endpoint looks something like this

https://demoaccount--dev.my.salesforce.com/services/data/v45.0/sobjects/Account/Profile_UUID__pc/112233

The payload looks like this:

{
    "FirstName" : "John",
    "LastName" : "Doe",    
    "RecordTypeId" : "0120C0000006eySWER",
    "Profile_UUID__pc" : "112233",
    "Email" : "[email protected]"
}

As you can see I'm trying to upsert using the Profile_UUID__pc which is a field in my Contact object that can be accessed using __pc affix. Despite Contact.Profile_UUID__c being set as an External ID, and it being accessible to all profiles I cant upsert using it.

I get the following error:

[
    {
        "errorCode": "NOT_FOUND",
        "message": "Provided external ID field does not exist or is not accessible: Profile_UUID__pc"
    }
]

When I describe the Account object I can see that field is definitely available, but interestingly it shows "externalId": false in the field schema.

Can we not upsert using fields from the Contact object in Accounts?

2 Answers 2

0

You cannot upsert on the Account object using an External Key from the Contact object. I've had to move the fields into the Account object instead.

-2

I don't think you can directly pass the external Id in the payload. Try something like this:

{
    "FirstName" : "John",
    "LastName" : "Doe",    
    "RecordTypeId" : "0120C0000006eySWER",
    "Contacts" : {"Profile_UUID__pc" : "112233"},
    "Email" : "[email protected]"
}
2
  • The payload above would be correct if I were trying to link to a Contact record using the Contact field lookup. Jul 1, 2019 at 11:48
  • I'm not sure if you figured this out already but here is some insight from Salesforce. hope this helps success.salesforce.com/…
    – Raj
    Jul 8, 2019 at 16:19

You must log in to answer this question.

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