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

VF Help: Restrict users (non-record owners) to see all details in the record. How?

Hi Experts, 

I am pretty newb with VF. I need some assistance with codes. How can I prevent the users (non-record owners) to see all details in the record. Ie. If the running user is not the owner of the record, he/she should only see the Company Name and Owner field on Leads.

Thank you.
SandhyaSandhya (Salesforce Developers) 

You can restrict individual fields from view per profile by going to the specific fields and selecting Set Field-Level Security.

Based on record owner.

Please refer below post.
Hope this helps you!

If this helps you mark it as solved.

Thanks and Regards