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
Sean Fife 9Sean Fife 9 

Non-unique values in unique External Id field?

Ok, so we have an External Id field that's sets to unique case-insensitive, yet we have about 200 records with the same value. And it's either blank or null values repeated between records.  What gives? Is this expected behavior? My searches have turned up nothing on this.  Is this really, unique except...?
Best Answer chosen by Sean Fife 9
StephenKennyStephenKenny
Hi Sean,

The field is only unique when it contains data. Blank or nulls dont count. Perhaps you have a workflow rule or trigger to automatically populate this field or perhaps this is a case of older data that may have existed prior to the field being unique? In any case, the field will only validate unique when data is entered - at the point of save, if there are any other records that contain the same data, then you will be prevented from saving.

Hope this clears things up but let us know if you have any further questions.

Please remember to mark this thread as solved with the answer that best helps you.

Kind Regards
Stephen

All Answers

StephenKennyStephenKenny
Hi Sean,

The field is only unique when it contains data. Blank or nulls dont count. Perhaps you have a workflow rule or trigger to automatically populate this field or perhaps this is a case of older data that may have existed prior to the field being unique? In any case, the field will only validate unique when data is entered - at the point of save, if there are any other records that contain the same data, then you will be prevented from saving.

Hope this clears things up but let us know if you have any further questions.

Please remember to mark this thread as solved with the answer that best helps you.

Kind Regards
Stephen
This was selected as the best answer
Sean Fife 9Sean Fife 9
Well, I confirmed what you said - except for the blanks and nulls don't count. It will allow me to load those duplicate blank/null values unchecked via the API, but in the Salesforce UI I cannot save those records without filling in the external id field with something other than blank/null (the field is not set to be required).

Thanks, Stephen.