function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Aaron Bauman 15Aaron Bauman 15 

Why does upsert on Contact.Email work?

In my new sandbox org, upsert on Contact.Email is working somehow, even though I did not expect it to.
I'm using Contact.Email just like a external id + unique key, even though it's not set that way, for upserts and read-by-external-id operations.

Maybe it's Nonprofit Starter Pack?
Another other add-on?
I stumbled across this completely by accident.
I didn't even know it was possible for apps or packages to intercept an upsert request in this way.
Does anyone know anything about this?
SalesFORCE_enFORCErSalesFORCE_enFORCEr
May be because Email is Indexed on Contact by default.
Aaron Bauman 15Aaron Bauman 15
Maybe? But if so, this is an undocumented feature or a bug.

According to all the documentation I can find, the field must be marked "external id" or "idlookup" to be used for upsert.
Indexing is not mentioned at all as any part of this criteria.
https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_calls_upsert.htm
https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_upsert.htm
https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_sobject_upsert.htm