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
michaelforcemichaelforce 

Calling SOAP API from Apex, describeLayout() result too big

I've built a native application which needs Page Layout info.  You can't call describeLayout directly in Apex, so my workaround is to use a web service callout to call the SOAP API.  It works really well, BUT a few customers are unable to use the app because the call fails due to the describeLayout response being greater than the maximum response size that Apex can digest (3MB).

I have no idea why the response is so larger... the orgs in which I've investigated have a very reasonable number of fields, layouts, record types, etc.

So my questions for you experts:  What the heck is in this response that could be making it so large?  How can I work with the customer to somehow get the response size down?  Any recommendations?
pconpcon
The only thing I could think of is a combination of large picklists with several record types.  When running a test on my sandbox, I see that the picklist values are repeated for each of the page layouts.  So if they had a picklist that had 150 options and they then had 4 record types (and thus 4 page layouts) they would end up with 600 picklist entries in the XML payload.  Multiple that by several picklists (and don't forget tags) and the amount of data gets big fast.  I can't say for certian that this is your issue, but my guess is that it is not helping the issue.
pankajmehra009pankajmehra009
Hi Michael,

Can you   help me out in calling Soap API from APEX , I am in a suitation where i need to query the dependancy of picklist from apex code.

Can you please share your work regarding fetching  DescribeLayout() call in APEX

Thanks in Advance

 
Cameron MathersCameron Mathers
Michael,

Did you get an answer to this problem?