+ Start a Discussion

Composite fields to enforce uniqueness - custom object.

Hi, experts - How can I have behavior in a custom object where using two fields (uniqueness) I need to restrict users not to enter duplicate rows ? In a relational database it would be like creating a composite index unique key; thanks
Best Answer chosen by Admin (Salesforce Developers) 

AFAIK, the way to achieve this is create a new field which will be Unique and CaseSensitive. Use workflow or trigger to populate that field with combination of your two fields.

This will ensure that you have composite unique key.