I am glad to share some salesforce knowledge with you. If you don’t want to update values into view state, i am given you the best solution use ‘transient‘ keyword in front of the instance variable. why we use this variable? In real time we got maximum view state size limitation error. To avoid this, you need to use this.
Example,
Visualforce Page :-
<apex:page controller=”SOSLController” sidebar=”false” docType=”HTML-5.0″>
<apex:form >
<apex:inputText value=”{!searchStr}”/>
</apex:form>
</apex:page>
Apex Class –
Public with sharing class SOSLController{
Public transient String searchStr{get;set;}
}
Output: –
The below output for using instance variable.
The below output for using instance variable with transient keyword.
We are the ISV Partners and Please reach us for custom development => www.merfantz.com
———————— We hope it will help to you ——————————-