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
drew5101drew5101 

Restrict a field based on data in same field in other records.

I have an object that stores billing profiles for patients and would like to have one selected as the default to be used for automated processes.  However, there are numerous patients listed in the object.

 

I need to restrict the ability to have more than one selected as default, on a per patient basis...

 

For example a portion of the object may look like:

 

record1   patient 1   cash         dr.jones   makedefault(unchecked)

record2   patient 6   insurance  dr. smith  makedefault(checked)

record3   patient 1   insurance  dr. jones  makedefault (checked)

record4   patient 1   insurance  dr. smith  makedefault (unchecked)

etc...

 

I need to make it so that only one record per patient can have a checked makedefault checkbox...

 

I have tried using VLookup as a validation rule, but am having no luck.  Also, I am not very strong in programming (obviously).  Any help is appreciated.

 

Thank you,

Drew