Salesforce Dictionary - Free Salesforce GlossarySalesforce Dictionary
DictionaryVView State
DevelopmentAdvanced

View State

In Salesforce Visualforce, the state data that is serialized and stored in a hidden form field on the page, preserving controller data between server requests so the page maintains its context during postbacks.

§ 01

Definition

In Salesforce Visualforce, the state data that is serialized and stored in a hidden form field on the page, preserving controller data between server requests so the page maintains its context during postbacks.

§ 02

In plain English

👋 Study buddy

View State in Salesforce Visualforce is the state data serialized and stored in a hidden form field on the page. It preserves controller data between server requests so the page maintains context during postbacks. Large view states cause performance issues.

§ 03

Worked example

scenario · real-world use

A Visualforce page at Easterton Software with a complex form maintains its server-side controller state via View State - a hidden form field on the page containing the serialized controller properties. When the user submits the form, the View State travels back to the server, the controller deserializes it, processes the input, and re-renders the page. Large View States (over 135 KB by default) cause performance issues and governor-limit errors; the developer trims unused properties from the controller to keep View State small. View State is a Visualforce-specific concept; Lightning components handle state differently (component state, Apex calls).

§ 04

Why View State matters

In Salesforce Visualforce, View State is the state data that is serialized and stored in a hidden form field on the page, preserving controller data between server requests so the page maintains context during postbacks. The view state has a 170KB limit.

View state management is one of the trickiest Visualforce performance challenges. Large view states slow page loads because all the data must be serialized, sent to the browser, and sent back on every postback. Mature Visualforce developers minimize view state by using transient variables for data that doesn't need to persist.

§ 05

How organizations use View State

CodeBridge

Teaches view state optimization as critical Visualforce performance skill.

TerraForm Tech

Uses transient variables to minimize view state in complex Visualforce pages.

Quantum Labs

Monitors view state size as part of Visualforce performance management.

§

Trust & references

Official documentation

Straight from the source - Salesforce's reference material on View State.

Was this entry helpful?
Help us write better definitions. Quick reactions or detailed edit suggestions.
§

Test your knowledge

Q1. What is View State?

Q2. What's the size limit?

Q3. How do you reduce view state?

§

Discussion

Loading…

Loading discussion…