When customer tried to Generate PDF Quotes with 700+ Lines he got System.LimitException: Apex heap size too large: 6451849
If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √
Solved! Go to Solution.
The out of the box button tries to load the content of the PDF into the Salesforce platform, which can lead to governor limits at high volumes.
As per the current Apex Governor Limits the maximum Heap size is 6000000. But in our scenario when we are generating Pdf Heap Size reached 6451849.
Instead, you can use "Generate quotes document" REST API call to generate a Quote document for a high-volume Quote. The URL of the generated Quote document will be returned for a successful call.
See the documentation below: