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
mahesh reddy 4mahesh reddy 4 

how to overcome the viewstate limit of 135kb?

AshwaniAshwani
Try to avoid extra variables in <apex:form>. Use transient as much as possible. Do not query extra fields in SOQL or SOSL. Keep optimezed you code and make it do what is expected only with scalability.
nitesh gadkarinitesh gadkari
Some tips to overcome viewstate limits:-

1. Use Transient keyword  for variables which are  storing temporary values.
2. Declare variables as Static wherever possible as they are not included in view state.
3. Refine Your SOQL to Retrieve Only the Data Needed by the Page.
4. Use Custom Objects or Custom Settings to Store Large Quantities of Read-Only Data.
5.Use HTML forms instead <apex:form>.
6.Use HTML components instead of <apex:commandbutton>,<apex:commandlink> ,etc to make your page stateless which saves hitting view state limits.

Consider studying below link article.It is the best.
https://developer.salesforce.com/page/An_Introduction_to_Visualforce_View_State

Avidev9Avidev9
There is a good old post on SE about the same http://salesforce.stackexchange.com/questions/8226/how-can-i-omit-properties-from-the-view-state