Join Sara Morgan for an in-depth discussion in this video Solution: Rewrite page to reduce view state, part of Improving Visualforce Performance.
- So here's how I went about resolving this problem.…As you remember, the Search Leads page will do a search,…let's just do a search for everything with the word "com"…and that returns a whole bunch of records.…And if I click back to the View State, you can see…at this point it's a little over 6.5KB,…but again, I don't have that many.…And if I expand out Search Leads and go down to Controllers,…you'll see I actually have 15 results here.…
I'm also keeping a Boolean variable called Searched,…and another one called searchText.…Now, I do need to keep that Boolean variable…because that's what tells it that it has been searched,…and so this is what helps the actual error messaging…on that page, and keeps track of where it is.…So that variable does need to stay there.…I also need the searchText to be passed between the page,…but I don't need the results because they are not used.…
They don't have to be kept in View State.…So you'll see that is a variable called Results,…and if I go back here to the Controller and scroll…
- Reducing and eliminating view states
- Evaluating SOQL for efficiency
- Using Workbench and the Query Plan tool to evaluate queries
- Reducing use of action tags through Visualforce remoting
- Working with the StandardSetController class
- Using static resources
Skill Level Intermediate
1. Getting Started
2. Reducing or Eliminating View State
3. Evaluating Queries for Efficiency
Limiting data returned10m 8s
4. Reducing Use of Action Tags
5. Taking Advantage of StandardSetControllers
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.