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
vishnuvishnu 

Restrict field visibility conditionally

Hi,

I want to restrict certain fields of Contact object to non-owners of the record. Users will have the same profile settings and only owners of the records will be able to view all the fields. Is there a way to do this in Salesforce?  I  saw that  there was a way to  restrict edition through non-owners by way of validation rules. It would be great if we have the visibilty controlled through ownership as well. If this is not possible in salesforce, what's the work-around you guys suggest?

Thanks,
Vishnu


Ron HessRon Hess
you could write an inline s-control to show the data for a field only if the user is the current user, however the data field itself would show up in reports, so not truly hidden.

i don't know of any other workarounds for this, private sharing on the field level, is not a current feature.
vishnuvishnu
Thanks so much Ron for the quick reply. We have decided to have another custom object and replicate the data of that object with contact object and sync it as when this gets updated. The contact object will have public sharing and only few fields visible and contact detail (all fields visible) will have private sharing so that owner and only shared users can view the entire data. This looks okay except for issues of syncing correctly.

Ron HessRon Hess
nice solution!