It is pretty straightfoward. I want to hide/restrict some standard fields from the Account object based on the user's role. Is it possible to achieve? If so, how?
1 Answer
I do not believe that Roles can be used to restrict field access. The primary use of Roles is to define record-level access.
For field-level access, the primary tool is the Profile (changing FLS settings on a field on an object affects the profile). Permission Sets can be used to grant access to individual users.
In (I believe) all cases, permissions are strictly additive. That is, once granted a permission, it cannot be revoked except for by removing that permission from everything that grants that permission.
If that wasn't enough, not all Standard fields can be made invisible through profiles (they will always be at least read-only). These are "system" fields like the standard Name field for the object, OwnerId, RecordTypeId, CreatedDate, CreatedById, LastModifiedDate, and LastModifiedById.
The closest tool we have to what you're asking for would be Page Layouts. Some standard fields can be removed from a Page Layout, and you can assign Profiles to use different page layouts (and different layouts by Record Type, if your object has at least one custom Record Type defined for it).
-
1
-
4@PranayJaiswal ah, today I learned. Looks like standard fields can't be muted (looked at Account's standard AccountName, OwnerId, RecordTypeId, CreatedBy, LastModifiedBy)– Derek FJan 26, 2022 at 17:38