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
manu K 22manu K 22 

How to Fix view State Error in Salesforce

I Need to Sloved Problem How to Fix view State Error in Salesforce

please, 
Manu K @ vbtcafe (https://www.vbtcafe.com/)
RbnRbn
Best Practices for Optimizing View State:

a)Minimize Number of Forms on a Page
b)Declare Variables as Transient to Reduce View State
c)Recreate State versus Storing It in View State
d)Use Custom Objects or Custom Settings to Store Large Quantities of Read-Only Data
e)Refine Your SOQL to Retrieve Only the Data Needed by the Page
f)Refactor Your Pages to Make Its View Stateless
g)Consider Doing Your Own State Management in Certain Cases

Also you can refer the below blog .

http://forceguru.blogspot.com/2010/11/best-practise-to-write-apex.html