talk2bks | Posts: 34

String length exceeds maximum 6000000 in Salesforce

0 votes

I'm having an issue when sending the pdf to OneSpan. This is the error from the dev console

"String length exceeds maximum: 6000000"

Is this because my files are too large? What's the fix?

 

 


Duo_Liang | Posts: 3776

Reply to: String length exceeds maximum 6000000 in Salesforce

0 votes

Hi Brian,

 

Thanks for your post!

Yes, this is because the files are too large. Salesforce has a general heap size limit of 6mb for synchronized call and 12mb for asynchronized call:
https://help.salesforce.com/s/articleView?id=000384468&type=1

If it happens very occasionally, you can try to reduce the size of the documents. Or if you hit the limit often, you can use the Salesforce Future annotation to identify methods that are executed asynchronously so that you get the 12mb limit in this case:

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_annotation_future.htm

 

Duo

 


Hello! Looks like you're enjoying the discussion, but haven't signed up for an account.

When you create an account, we remember exactly what you've read, so you always come right back where you left off