salesforce - Getting heap size error while serializing collection of records in apex -
i suffering salesforce apex limitexception issue. fetching thousands of records few objects , putting collection map. have requirement generate json same records used mobile devices download data salesforce. when tried serialize records using system.json.serialize() method; generating huge json string , getting system.limitexception error because there more memory required available space. tried catch issue using try/catch block here reference available says system.limitexception can’t caught catch block. referral url:
http://www.salesforce.com/us/developer/docs/apexcode/content/apex_classes_exception_methods.htm
i know can check heap size limit through limits.getheapsize() method. there work around can handle issue apex side. code sample or reference in regard highly appreciated. in advanced.
an alternative use batches in apex code. apex batches
you can send records in start() method , process json serialization in execute() method.
Comments
Post a Comment