Make a record visible to only a person in a field

Grace: 6 days ago

I will be making a bunch of new records for a custom object through an import with Data Loader. One of the fields I will be populating will be a lookup field to the User object.

What is the best way to make these records visible to only the person who will be named in that field in that particular record ?

Thank you very much for your feedback.

Camila: 5 days ago

Since there is no mention of what your data is or what it's used for, based on your comments in a simple answer:

  1. Make your object not a detail to a master object so that you can control it's visibility independently from the parent.
  2. Set the OWD for this object to Private
  3. Create a lookup to the "parent" instead of a master-detail as appropriate
  4. Set the OwnerId field on the record to the value of the user that you would have used for the custom field value.

In this scenario, your record's owner can see the record as well as anyone above them in their role hierarchy.