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
Iqra TechIqra Tech 

why error occurs when i search two values from the vf page

User-added image

In that scrren shot i am selected Opportuntiy Line itme object according to i have to select multiple fields according to which object was selected then after according which ever first field was selected i need to search records according to the fiirst field ex : I have selected Edition Name is field in that having values like Adipec 2018,Adipec 2017 then this error occurs why ???

see this error scrre shot

User-added image

why this error occurs ???? any sloution on that ..??
Best Answer chosen by Iqra Tech
Khan AnasKhan Anas (Salesforce Developers) 
Hi Iqra,

Greetings to you!

alesforce allows Visualforce pages to have a maximum view state size of 135KB.
The View State tab shows you which elements on your page are taking up that space.
A smaller view state size generally means quicker load times.
In order to avoid this error, minimize your pages' view state. You can optimize your Apex controller code and remove any superfluous Visualforce components used.

For example:
  • If you notice that a large percentage of your view state comes from objects used in controllers or controller extensions,consider refining your SOQL calls to return only data that's relevant to the Visualforce page.
  • If your view state is affected by a large component tree, try reducing the number of components your page depends on.

For more information regarding the View State, review About the View State Tab: https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_tools_edit_toolbar.htm

Reference: https://help.salesforce.com/articleView?id=000002955&type=1

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas