I am bit confusing on security part of salesforce.

I have a situation where certain fields of an object X has to be disabled for a profile P. But the users in the same profile P, if they are the owner of the record then they can see the restricted fields. How do i achieve this?

For example i have an object Market and i have few fields related to finance. Now i have a 'generic user' profile where i have restricted the finance related feilds. But the users from the 'generic user' profile who owns the record should be able to see the finance related fields.

Is there a way??


There are record-level security controls (sharing) and there is field-level security by profile. However there is no such thing as combined "record-level field security".

What you might be able to do is give the profile access to the fields but hide them from the object page layout used by that profile. You could then add an item to the Lightning App Builder page layout that conditionally displays the extra fields when the record's owner ID = the user ID.

The simplest item you could add to the Lightning page would be an "Update Record" Quick Action which surfaces the fields you want to be visible. Once you create it, you can add this to the page using the App Builder "Related Record" component. Alternately you could create a quick no/low code Lightning component using Lightning Data Service that surfaces those fields, and put that on the record page.

  • I would like to share that i have thought of a work-around here. Can u verify it is feasible. I thought of writting a trigger which will be invoked once the record is saved. In the trigger it will fetch the record owner and the assign that user the custom permission set that i have already created. Is this possible?? – Smruti Ranjan Biswal Feb 28 '19 at 12:34
  • I don't see how a permission set would help your use case. If the PS includes permissions for the finance fields, assigning it to a user will give them permissions for those fields across ALL records, not just the ones they own. – Charles T Feb 28 '19 at 13:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.