All that is needed is a simple validation rule with the error formula set to the following:
Name = VLOOKUP( $ObjectType.Object.Fields.Name , $ObjectType.Object.Fields.Name , Name ) && Id <> VLOOKUP( $ObjectType.Object.Fields.Id , $ObjectType.Object.Fields.Name , Name )
However, there doesn't seem to be an easy to to perform a case-sensitive comparison in the formula builder. Another thought would be to do the following to enforce name uniqueness:
- Create a text field called Unique Name on the object, and add the case-sensitive uniqueness constraint.
- Create a workflow field update called Unique Name that just sets
Unique_Name__c
toName
. - Create a workflow rule called Set Unique Name that's triggered every time a record is created or updated.
- Activate the workflow rule.
Last edited on 8/10/2011.