You need to sign in to do that
Don't have an account?

issues with getContent()
Hi, I have an Apex class that creates a PDF attachment for each id that it is passed.
This works great when only 50 or so IDs are passed in, but any more than that and I get a Heap error.
I read somewhere that I could create a webservice in Apex to get around this, but I can't find any documentation about calling a salesforce webservice from within the same salesforce org.
If anyone can point me in the right direction, or suggest a different solution, that would be greatly appreciated!
I wasn't able to figure out a way around it, so I am just limiting the PDF creation to 100 records at a time.
All Answers
You could use a class that implements Database.batchable.
You basically schedule a batch job to run on its own, say, 50 records at a time, to avoid hitting the ceiling limits.
See this page for a more detailed explanation:
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_batch_interface.htm
If you need any technical help, feel free to give us a ring.
Gabriel Alack
Contact Us - We Can Help!
Salesforce Superheroes
------------------------------
help@salesforcesuperheroes.com
www.salesforcesuperheroes.com
1-888-407-9578 x122
Hi. Thanks, but getContent() is not supported in Batch Apex. So, that won't work.
Did you see this page?
http://stackoverflow.com/questions/9404751/why-are-html-emails-being-sent-by-a-apex-schedulable-class-being-delivered-with
Gabriel Alack
Contact Us - We Can Help!
Salesforce Superheroes
------------------------------
help@salesforcesuperheroes.com
www.salesforcesuperheroes.com
1-888-407-9578 x122
I wasn't able to figure out a way around it, so I am just limiting the PDF creation to 100 records at a time.