1

I was facing the below error.How can i catch the below error in debug logs.will it be possible to catch it in logs.

"Maximum view state size limit (135KB) exceeded. Actual view state size for this page was 139.078KB".

2 Answers 2

1

Common causes of this problem:

  • Failing to make a Blob field that a file upload is done into transient
  • Querying and holding onto in non-transient fields Blob objects such as Attachment bodies
  • Querying and holding onto in non-transient fields very large numbers of SObjects
  • Outputting very large numbers of Visualforce components (apex:... tags); normally happens when using tables of data via apex:repeat or apex:pageBlockTable

If you can't figure this out by inspecting your code for these patterns, the best way to track this down is to find a way to get your page to display without hitting the error (e.g. different inputs to the page) and then use the View State Inspector to see what is contributing to the problem.

0

You can't catch this error in log - since it is View State issue. View State is limited to 135KB, you just need to decrease amount of data that is displayed and/or page structure.

Please check:

https://help.salesforce.com/apex/HTViewSolution?urlname=State-size-limit-1327107599450&language=en_US

https://developer.salesforce.com/docs/atlas.en-us.salesforce_visualforce_best_practices.meta/salesforce_visualforce_best_practices/pages_best_practices_perf_code_view_state.htm

3
  • 1
    i did not find any proof stating that logs cant be catched .
    – dileep
    Commented Nov 22, 2016 at 9:59
  • The very nature of View State make it not possible to fully see in server log. developer.salesforce.com/page/… Commented Nov 22, 2016 at 10:03
  • Even if you don't want to log it can you not catch the view state error then display a custom message instead ?
    – MadMax
    Commented Aug 1, 2018 at 15:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .