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
Gopikrishna DasariGopikrishna Dasari 

We have salesperson, Supervisor and Manager The salesperson user records able to see their managers but the should not be changed as owner the record they can be able to edit remaining fields how can we do this

Please help me in this
VinayVinay (Salesforce Developers) 
Hi Gopikrishna,

You can try below validation and above will fire whenever salesperson is trying to change owner of the record. 
OR(PRIORVALUE(OwnerId) <> "id of salesperson", ISCHANGED(OwnerId))
Please mark as Best Answer if above information was helpful.

Thanks,
Gopikrishna DasariGopikrishna Dasari
Hi Vinay,

My question is owner of the record only can be able to change the owner to another person.

Thanks.
VinayVinay (Salesforce Developers) 
Try below one.
AND(
ISCHANGED(OwnerId),
$User.Id <> PRIORVALUE(OwnerId)
)
This will prevent all users from changing owner of records which they do not own.

Hope this helps...

Thanks,
Gopikrishna DasariGopikrishna Dasari
Hi Vinay,

Thanks for your answer.

Thanks,
VinayVinay (Salesforce Developers) 
Please mark as Best Answer if above information was helpful.

Thanks,