I want to list out Read and Write permissions for a few fields on an object from a profile. I have a profile named CAPI and under the profile I want to find out all the field permissions from Account object. I've constructed this query for it
SELECT SObjectType, Field, PermissionsRead, PermissionsEdit FROM FieldPermissions WHERE SObjectType = 'Account' AND Field IN('Name','ShippingStreet','ShippingCity') AND Parent.Profile.Name = 'capi'
But no data gets exported when I execute it. What am I doing wrong? Any suggestions would be appreciated.
First of all, fields in
FieldPermissionsobjects follow theObject.FieldNamepattern e.g.Account.Phone.Second, there is no fields like
ShippingStreetandShippingCityon Account because they are part of a compound field calledShippingAddress.As for the last, there is no permission to Name field listed in
FieldPermissionsobject, as permission to this field depends on object permission. So your query should look like