Activity Forums Salesforce® Discussions What are the effects of using the transient keyword in Visualforce Page?

  • Avnish Yadav

    Member
    August 3, 2018 at 6:30 am

    Hello Chanchal,

    Use the transient keyword to declare instance variables that can't be saved, and shouldn't be transmitted as part of the view state for a Visualforce page.

    For example- Transient Integer currentTotal;
    You can also use the transient keyword in Apex classes that are serializable, namely in controllers, controller extensions, or classes that implement the Batchable or Schedulable interface. In addition, you can use transient in classes that define the types of fields declared in the serializable classes. - Salesforce

    Thanks.

  • Prachi

    Member
    August 3, 2018 at 6:37 am

    Hello Chanchal,

    We Use the transient keyword to declare instance variables that can't be saved, and shouldn't be transmitted as part of the view state for a Visualforce page.

    You can also use the transient keyword in Apex classes that are serializable, namely in controllers, controller extensions, or classes that implement the Batchable or Schedulable interface. In addition, you can use transient in classes that define the types of fields declared in the serializable classes.

    Thanks.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos