Activity Forums Salesforce® Discussions How to maintain state using transient keyword for List in Salesforce?

  • Manpreet

    Member
    January 30, 2018 at 4:22 pm

    Hi Subramanyam,

    Using "transient" or "static" keyword to declare the list will not be transmitted as part of view state for Visualforce page hence it becomes null each time Visualforce Page gets Refreshed.

    Remove that and you are ready to go.

    [Static & Transient variables are not saved in the viewstate and hence are get lost after a http invocation]

    Thanks.

  • Guha

    Member
    January 31, 2018 at 9:14 am

    Remove the transient keyword for List and you must be good to go. If you are hitting view state error. Try using maps instead of lists.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos