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
salesforce_hoonigansalesforce_hoonigan 

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) 
Hi,

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

https://help.salesforce.com/HTViewHelpDoc?id=admin_fls.htm

Based on record owner.

Please refer below post.

http://salesforce.stackexchange.com/questions/4520/can-you-limit-the-visibility-of-fields-based-on-record-ownership
 
Hope this helps you!

If this helps you mark it as solved.

Thanks and Regards
Sandhya