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
Katie SilorioKatie Silorio 

Queries for hidden fields by profile and available fields by layout

I want to query permissions data for various objects in our SF instance. I'm able to query PermissionsRead and PermissionsEdit from FieldPermissions, but I also want to pull data broken down similar to the screenshot below, but for fields in the object.
User-added image

I'd also like to be able to query what fields are shown in each page layout and which profile is assigned each page layout for the object.

Is this possible?
Alain CabonAlain Cabon
I resolved these problems with different techniques (apex and Xquery requests on the exported metadata).

With Apex, there are now the Layout Class with LayoutSections with LayoutColumns with LayoutItems containing fields (quite complicated)
 https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_class_Metadata_Layout.htm

The problem with Apex is to get the complete list of layouts (I solved it difficulty).

There are surely plenty of new free Appexchange tools that export the layouts (but if often one by one, not all the layouts ).
  • Config Workbook ( ... but FREE means often trial period or limited version in reality ):
  • This is tool very useful to extract the metadata from SALEFORCE Org in excel format.
  • it covers FLS,Profile Details, Layout detail, Permission set , Permission set assignment, Apex detail,Approval Process, Custom Application,Static Resource,Visual Flow, Custom Meta data, Object Fields Visibility on Layout.
  • Admin can go through the Org permission(s) very easily because all the information available in single file
https://appexchange.salesforce.com/appxListingDetail?listingId=a0N30000000q4evEAA

If Config Workbook doesn't cover your need, did you already export all your metadata (package.xml and workbench/ant tool) ? 
Alain CabonAlain Cabon
The problem with Apex is to get the complete list of layouts (I solved it with difficulty).