You need to sign in to do that
Don't have an account?
Ayush Jain 116
Maximum View state size limit (170K) exceeded error
I have created a invoice creation page using VF page, for smaller data it is working fine but for larger data it is giving above error.
Can i increase this limit or what should i do ?
You're basically trying to store every record in the database in the view state. Check about dynamic queries (https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_dynamic_soql.htm) and this will greatly improve your code's performance and allow you to avoid view state size errors, heap limit exceptions, CPU timeouts, too many query rows, etc.
Check below reference for debugging size limit error.
https://help.salesforce.com/articleView?id=000321547&type=1&mode=1
https://help.salesforce.com/articleView?id=000323828&type=1&mode=1
If this helps , please mark this as best answer.
Thank you.