function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sanjay NandiSanjay Nandi 

export Field level security

Hello,

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.
CNishantCNishant

Hi Sagar,

Can you post how to do that using metadata API?


Thanks

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"