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
Ramki DhananjayRamki Dhananjay 

Querying fields of a particular pagelayout

Hi
I have a requirment where i should list all the fields used in a pagelayout as a table.
I tried using describelayout()  but got Invalid Type describelayout error. is there a way to acheive this..?
NehalNehal (Salesforce Developers) 
Hi,

DescribeLayout() call won't work in pure APEX. The reason for this behavior is that we do not have the  DescribeLayoutResult type in APEX and you will get COMPILE ERROR: Invalid type: DescribeLayoutResult. However, the following can be used through Metadata API.

Please refer to below link for your reference:

1.https://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_describelayout.htm
2.https://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_describelayout_describelayoutresult.htm
3.https://developer.salesforce.com/forums/ForumsMain?id=906F00000008vcXIAQ
4.https://success.salesforce.com/ideaView?id=08730000000BpHAAA0
5.http://salesforce.stackexchange.com/questions/14391/get-all-page-layouts-for-an-object-via-api


I hope this helps. Please mark this as a ""Best Answer"" if this has resolved your issue.