I am trying to do analysis on the number of fields comparing 2 different page layouts and Could not find an easy way to count the number of fields added to a page layout. Would anyone be able to assist me? I attempted to copy all of the fields and paste it into notepad which didnt work well.

2 Answers 2


You could use the describeLayout() API method to pull details about the page layouts for an object.

Drill down into the returned DescribeLayoutResult to find the DescribeLayoutComponents with the LayoutComponentType/type of Field. The value will be the name of the field being used on the page layout.


One option might be to load up your project in the Force.com IDE, making sure that you select Layouts in the metadata when creating a project:


Once your project is created select both layout files, right click and Compare To each other to get a diff between the two files.

You must log in to answer this question.

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