+ Start a Discussion
Sanjay NandiSanjay Nandi 

export Field level security


I want to export field level security(Read Only,Visible) of objects by profile using apex.

i have tried using fieldPermission,PermissionSet,ObjectPermission object. but the value i am  getting is not as per the Expectation(As per field level security on profile). 

im planning to have this sheet as reference to see all the fields of an object if they are Read Only ot Visible.
Sagar PareekSagar Pareek
Yes, using the Metadata API.  You can see it in action by downloading your field info in the Force.com IDE.

Hi Sagar,

Can you post how to do that using metadata API?


Sanjay NandiSanjay Nandi
Hi Nishant,

Used these metadata objects to reterive the FLS  "fieldPermission, PermissionSet,ObjectPermission "
Note thei Fieldpermission and object permission will be associated to a Permission set or permission set which will be associated to Profile
Please refer this "https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_fieldpermissions.htm"