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
suresh dupadasuresh dupada 

HeepSize limit while Serializing Data

Hi all,
            I am hitting an heep size limit while serializing my records, I need to send this records as a response, so below my serializePretty method
actually result =[select Id, name ... from object]; ----------------> it returns nearly 8000 records, so i Need to  serializ 8000 records, and send to response in rest resources..... how to over come this issue
 
  return JSON.serializePretty(result);
ShashankShashank (Salesforce Developers) 
You may havve to break your request into batches. This discussion has some good suggestions: http://salesforce.stackexchange.com/questions/50258/getting-heap-size-error-while-serializing-collection-of-records-in-apex