Maximum view state size limit exceeded

  • 1
  • Problem
  • Updated 2 weeks ago
  • In Progress
I have a Skuid page I am using with Salesforce where I'm doing a csv file upload then comparing Opportunities and updating fields on the Opportunity (i.e. dates, stage, etc).  The file has grown and now I am getting the error:  "Maximum view state size limit (135KB) exceeded. Actual view state size for this page was 157.109KB" when try to upload a document.

There is a writeup on what needs to be done to fix it but I believe this is something Skuid would need to do on the platform (https://salesforce.stackexchange.com/questions/53112/maximum-view-state-size-limit-135kb-exceeded)

Has anyone come across this and/or is there a fix that's known to resolve this issue?

Thank you!
Photo of Ali Jenan

Ali Jenan

  • 100 Points 100 badge 2x thumb

Posted 3 weeks ago

  • 1
Photo of Stephen Sells

Stephen Sells, Official Rep

  • 17,264 Points 10k badge 2x thumb
I'm fairly certain you need to set the "readonly" attribute on their Visualforce page to true, like we do in basically every example on this page in our documentation.

Also, here's the applicable Salesforce documentation, which actually explains what that property does. I believe you might want to reach out to your salesforce admin for more questions.
Photo of Ali Jenan

Ali Jenan

  • 100 Points 100 badge 2x thumb
Stephen... that doesn't seem to work.  Below is the very simple code that is being used and I still get the error after adding the Readonly piece.

<apex:page readonly="true" standardController="Application_Import__c"
  extensions="skuid.Redirects"
  action="{!redirect}?objectType=Application_Import__c&actionType=View"> 
</apex:page>

I also thought it may be due to the number of blank lines (there is a blank line between each row in the csv) and I took those out but increased the number of rows to about 5,000 and now I am getting the following error...

Apex CPU time limit exceeded
Error is in expression '{!validateFile}' in component <apex:commandButton> in page skuid:import: (skuid)

We (OpenGate) are a partner of yours (Skuid) so I don't see a need to get my Salesforce Admin involved.  I have already had this issue looked at by our developers here and I was hoping this was something you could help me with.

Please advise on what you recommend to try next.