O'Reilly logo

Learning Apex Programming by Matt Kaufman, Michael Wicherski

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Staying classy

Whether you are implementing a built-in interface, controlling a Visualforce page, or facilitating a trigger logic, classes are the solution. While classes are often used as templates for objects that you construct, most of the examples we've shown so far leverage static methods in these classes. It's actually a best practice to call static methods stored in classes from your triggers, as they are more efficient on the server. There are times though where you want to do more than just call a single method, so let's take a look at some more complex functionality in classes.

When you plan on instantiating your class as an object, you often want to set some default values. If you are going to create multiple instances of this object, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required