Activity › Forums › Salesforce® Discussions › What are the effects of using the transient keyword in Visualforce Page?
Tagged: Apex Classes, Batchable Interface, Controller Extension, Keyword Transient, Schedulable Interface, Serializable Classes, Visualforce Page
-
What are the effects of using the transient keyword in Visualforce Page?
Posted by chanchal kumar on August 2, 2018 at 2:04 PMWhat are the effects of using the transient keyword in Visualforce Page?
Prachi replied 7 years, 9 months ago 3 Members · 2 Replies -
2 Replies
-
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. – SalesforceThanks.
- [adinserter block='9']
-
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.