I want to know whether the field level security is assigned through profile or permission set through SOQL.

  • if field is accessible and profile does not have it set then it has to be via perm set
    – Eric
    Jan 30 '17 at 4:26

It can be assigned through both (they can overlap), but you can generally find out by performing a query:

SELECT PermissionsRead, PermissionsEdit 
FROM FieldPermissions
WHERE Field = 'Account.Industry' AND
      Parent.IsOwnedByProfile = FALSE
      AND ParentId IN 
         (SELECT PermissionSetId 
          FROM PermissionSetAssignment
          WHERE AssigneeId = :UserInfo.getUserId()

You can change the fields or queries in a variety of interesting ways, depending on exactly what you're trying to find out.


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.