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
nagalakshminagalakshmi 

How to reduce the view state size

Hi, 

 

i am getting the error as ' Maximum view state size limit (135KB) exceeded. Actual view state size for this page was 135.344KB'. I am having morethan 5000 records but i am displaying 1000 records in my select option list. In view state 5000 records are loaded. I am getting this error. How can i solve this error. Please any one help me out.

 

Thanks,

Lakshmi.

SFDC_EvolveSFDC_Evolve

Make varibale as a Transient Variable .. It helps to reduce the View state . . 

 

Thanks 

SFDC_Evolve

nagalakshminagalakshmi

Hi SFDC_Evolve,

 

I tried with Transient Variable. But i am getting null pointer error. Is there any other solution to reduce the view state size.

 

Thanks

Chamil MadusankaChamil Madusanka

Refer following post

 

http://boards.developerforce.com/t5/Visualforce-Development/view-state-size-exceeded-any-ideas/m-p/424329#M48866

 

If a reply to a post answers your question or resolves your problem, please mark it as the solution to the post so that others may benefit.

haripopuri1haripopuri1

Hi,

 

Are you using pagination or trying to display everything on page?

 

Try using StandardSetController with pagination. You can set page size and it will return only the specified number of records to page and that will fix the ViewState error.

 

Thanks