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
sd2008sd2008 

quick question about Create()

If I have a record in Salesforce, and when I use Create() to create the same record, will it return an error message?
Best Answer chosen by Admin (Salesforce Developers) 
SuperfellSuperfell
If you mark a custom field as unique, then yes that is respected during create.

All Answers

SuperfellSuperfell
No, it'll create another copy. (perhaps you want to use upsert instead)
sd2008sd2008

there is a field in the record is unique field, will that force Create() to return an error and abandon the process?

SuperfellSuperfell
If you mark a custom field as unique, then yes that is respected during create.
This was selected as the best answer