I am having one custom object name as club with custom lookup field with contact object.

Let us assume we have 3 records in my club object(club1,club2 and club3).

When I assigned one member to club1 record , I shouldn't assign the same member to another record either in club2 or club3.

If I try to assign the same member to other club records I should be stopped with an error message.

How this can be achieved.

Thanks in advance


As a Lookup can not be unique, you will have to create a new text field(e.g:ContactId__c) and make it Unique, that's very important. Then by workflow, you can populate this text field from your custom lookup.

So now that means when you create a new member for the same contact, you will get the following error : "Duplicate value on record: 'Record_Name' (Related field: ContactId)"

  • Thanks its working fine. Can I customize this error message "Duplicate value on record: 'Record_Name' (Related field: ContactId)". – Mangoski Apr 22 '14 at 9:59
  • Unfortunately not with this solution. If you want a custom error message, you will need to go for a solution with a trigger which is more expensive as you will need some code and a developer. – Cloud Ninja Apr 22 '14 at 10:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.