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
si risi ri 

validation error related to user selection field

Hi everyone, 
 I have requirement that an Account has multiple contacts. If we select a 'talent' checbox field on one contact-1 then the user should not be able to select that 'talent' checkbox field on another contact-2 it should throw an error message before saving the record and also when we edit the record. It means only once that 'talent' checkbox field should be able to check on any one Contact. 
How can I acheive this, please help me with sample code.
Khan AnasKhan Anas (Salesforce Developers) 
Hi,

Greetings to you!

You can do it through process builder or triggers. Please refer to the below links which might help you further with the above requirement.

https://success.salesforce.com/answers?id=90630000000DHmFAAW

https://developer.salesforce.com/forums/?id=906F0000000BRKWIA4

https://salesforce.stackexchange.com/questions/47429/update-a-checkbox-on-a-record-to-uncheck-all-other-existing-records

https://success.salesforce.com/answers?id=90630000000goWSAAY

https://salesforce.stackexchange.com/questions/80499/validation-rule-to-allow-only-one-checked-record

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas