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

  • Piyush

    Member
    September 4, 2019 at 12:03 pm

    Hi Hariom,

    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

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos