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
SS KarthickSS Karthick 

View state

Hi folks
         Can anyone tell me  What is the purpose of view state  in salesforce?
Thanks in advance
Kartick
Best Answer chosen by SS Karthick
Deepak Kumar ShyoranDeepak Kumar Shyoran
View state is the form size of your page on which you are working at run time.
I've wrote a blog on view state which help to understand more about view state and how to reduce it.
Please visit below link for mew info on view state.
http://forcespider.wordpress.com/2013/10/21/how-to-reduce-the-view-state-of-a-page-in-salesforce/

All Answers

AshwaniAshwani
View state os atate of controller and it  is constructed from:

1) Number of member variable assigned in controller
2) Number of member variable used on page
3) Type of variables used on page for example List of wrapper class.
4) Nummber of variables used inside <apex:form> tag

Combiming above points define the size of viewstate. It is of two type: Internal and External. Internal is controller use for itself and external is constructedfrom properties used on page in <apex:from> tag.
Deepak Kumar ShyoranDeepak Kumar Shyoran
View state is the form size of your page on which you are working at run time.
I've wrote a blog on view state which help to understand more about view state and how to reduce it.
Please visit below link for mew info on view state.
http://forcespider.wordpress.com/2013/10/21/how-to-reduce-the-view-state-of-a-page-in-salesforce/
This was selected as the best answer
SamuelDeRyckeSamuelDeRycke
In my laymen understannding it's as following: Basicly when building websites/pages we think of server-page communication. To reduce performance requirements on the server, we have moved to stateless designs, where the server no longer "knows" what's on the page, and what needs to be remembered for the page to function properly. That state, and all data required, is kept on the page, as the viewstate. This means all of this data is communicated over the internet from the server to the page, and from the page to the server on every http request. This implies that if the viewstate becomes too big, loading your page gets slow. It's therefor recommended to keep your viewstate small.