
There are times when you need to grant field visibility (Read, Read/Write) to all users of a particular Profile (or Role, or Public Group). But you only want them to see the VALUES of that field if they have permission to do so.
The obvious example is commission. I have a custom object that includes commissions calculations among its fields.
1) All Sales Reps need to be able to see this object
2) All Sales Reps need to be able to see each other's records.
3) All Sales Reps need to be able to see the object's fields
4) However, within these records, for some of these fields, they should only be able to see the values if they apply to them. In the case of commissions, they should be able to see their own commissions and commission rates, but not those of other Salespeople. (It would be fine if the entire field were hidden if they don't have rights to see it, rather than just its value.)
I don't want to use a custom VF page because I want admins to be able to create new fields, remove old fields, and rearrange the page layouts without having to do all of that using custom coding for each change.
How can this be done?
2 answers
You would need to create a custom object to hold the commission information and relate it to the main object through a lookup relationship. You would make the custom object private, and then create a sharing rule to provide visibility to the person/people who should be able to see the related record (fields).