You need to sign in to do that
Don't have an account?
subaa
How to reduce View state size?
Hi,
I am getting the error, 'Maximum view state size limit (135KB) exceeded. Actual view state size for this page was 165.375KB' for one of the Visualforce page we used.
I could see some best practise to reduce this limit in Community. However, if anyone share me the way, you fixed this in your ORG would be more appreciated.
Thanks in advance.
Regards,
SuBaa
Hi All,
Thanks for your comments. We couldn't control the size as we have four table in the same page and each table holds the record count of 500 plus. We provided the User, an option to change the page size dynamically according to the number of records in the table. We identified that the maximum view state error was occured when it was greater than or equal of 100. So we reduced the page size and tested. Now its not exceeding the max view state size value.
Using the transient keyword, we could manage the state size in very less proportion only.
Regards,
SuBaa
All Answers
I hope you already tried stuff mentioned here
http://www.salesforce.com/us/developer/docs/pages/Content/pages_best_practices_performance.htm
http://wiki.developerforce.com/page/An_Introduction_to_Visualforce_View_State
Few quick ways that might help are
Hope this helps, best would be to share code so that we can suggest. Though i understand the code would be too big to fit in a forum question :)
Blogged some more info here :
http://forceguru.blogspot.com/2010/11/best-practise-to-write-apex.html
Thanks
Ankit Arora
Blog | Facebook | Blog Page
if you tried above two posts patterns and still getting the prob then check your page components and confirm those are not dependent on <apex:form> tag.. then you can remove <apex:form> tag from then code and try
Hi All,
Thanks for your comments. We couldn't control the size as we have four table in the same page and each table holds the record count of 500 plus. We provided the User, an option to change the page size dynamically according to the number of records in the table. We identified that the maximum view state error was occured when it was greater than or equal of 100. So we reduced the page size and tested. Now its not exceeding the max view state size value.
Using the transient keyword, we could manage the state size in very less proportion only.
Regards,
SuBaa