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

upsert of data where firled is not ID but some custom field


I want to upsert data, but how can I specify a custom field as key.
thank you for suggestion
Best Answer chosen by Ab
SwethaSwetha (Salesforce Developers) 
HI Sandrine,
Using the upsert operation, you can either insert or update an existing record in one call. To determine whether a record already exists, the upsert statement or Database method uses the record’s ID as the key to match records, a custom external ID field, or a standard field with the idLookup attribute set to true.



If this information helps, please mark the answer as best. Thank you