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
StefanStefan 

Look up field unique?

I have a lookup field on Account whcih looks up a custom object.
 
I would like this field to be unique on the account record. Is there any way using validation that I can enforce this.
 
Best Answer chosen by Admin (Salesforce Developers) 
SovaneSovane

Hi Stedan,

You could try the following workaround :

- Create a text field myFIELD on the account and define it as Unique

- Create a workflow rule that update myFIELD to store the id set in the lookup

This way it would be as if you had set the lookup field as unique.

Tell us if it works...

 If you had a master detail relation ship, you could have taken a Roll Up Summary field solution.

Message Edited by Sovane on 02-03-2009 12:25 AM

All Answers

SovaneSovane

Hi Stedan,

You could try the following workaround :

- Create a text field myFIELD on the account and define it as Unique

- Create a workflow rule that update myFIELD to store the id set in the lookup

This way it would be as if you had set the lookup field as unique.

Tell us if it works...

 If you had a master detail relation ship, you could have taken a Roll Up Summary field solution.

Message Edited by Sovane on 02-03-2009 12:25 AM
This was selected as the best answer
StefanStefan
Thanks for the suggestion. Will give it a try