Using Tooling API, or Reports, is there a way to find how many related lists are on each Page Layout ?

I am dealing with a large Org with more than 600 Objects, and some objects have more than 100 page layouts, with many related lists.

I used the following Query to get the count of Page Layouts on each object

SELECT TableEnumOrId, count(Id) FROM Layout WHERE ManageableState='unmanaged' group by TableEnumOrId 

Looking for a similar Query or any other approach to get the counts of related lists on each pagelayout as Optimizer Report did not give that detail.

1 Answer 1


Seems to me like the UI API is your best bet here. It has an endpoint for related-list-info that should do the trick. Definitely easy to pull the results in Workbench. Would be straightforward enough to parse via Apex as well if need be. You could even write a batch to aggregate all the results and save somewhere on platform, send them out as an email, etc.

GET /services/data/v53.0/ui-api/related-list-info/Account

Note that you can also pass recordTypeId as a query string parameter.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .