Find your content:

Search form

You are here

How to prevent duplicate user assignment to various record of same custom object

 
Share

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


Attribution to: Mangoski

Possible Suggestion/Solution #1

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)"


Attribution to: Cloud Ninja
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/33295

My Block Status

My Block Content