When creating custom fields, there are two settings most people ignore: External Id and Unique. When used properly, these boolean settings can be useful.
By setting a field as an External Id, you’re telling Salesforce that this field represents an Id field from a system outside of Salesforce. It’s helpful during integrations, and this field becomes more predominant when using the global search.
Fields with this attribute can also be used to update records, rather than using the standard Id field.
By contrast, the Unique setting says that values in this field must be unique for all records. Duplications are not allowed, and Salesforce displays a message when you attempt to create a record with the same value.
This can replace a validation rule that checks for uniqueness.
Note that you can technically have more than one record with the same External Id. This is not recommended though. So it’s common to set an External Id field as Unique as well.
The takeaway
Using the External Id and Unique attributes of custom fields can help with integrations and value uniqueness.