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
AnjaneyluAnjaneylu 

Only the selected user can able to edit the record..

Hi 
i have a custom object with field sales_reps__C (lookup relation ship) to user object.
After saving the record , The record can be edited only by the selected user.
Other than that user no one can edit the record. how can you achieve this ?

Thanks in advance
Anji
Chandra Sekhar CH N VChandra Sekhar CH N V
Try using a validation rule - 
IF(ISCHANGED(<any field>), AND(($User.Id <>'<record id(s) of users>'), false)
The above ensures if record ids apart from mentioned user tries to change the record and save, error will be thrown.
 
AnjaneyluAnjaneylu
Hi  Chandra Sekhar ,
Here the scenario is  i have one Object name Custom_object__C and it is having one field Sales_reps__c (lookup to User Standard Object).
After selecting the any user then saving the record, the only selected user can able to edit the record only..
Other users cant able to edit the record..
but here you are saying that to add users id.how we know the which user was selected..

Thanks in advance,
Anji
Chandra Sekhar CH N VChandra Sekhar CH N V
You mentioned 'Selected User'. Who will be those selected users (like only record owner/user from a specific profile) ? On what basis you are classifying them? 

Also, who are all will be considered as 'Other Users'? Can you please elaborate your request further.....