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

Extending control

There are times where it might make more sense to use a custom controller, for example, if the page is not tied to a specific type of sObject. However, there are also times where the page is tied to a specific type of sObject and the standard controller makes more sense, but you just need one extra bit of data or functionality. Unfortunately, pages can only use either a standard controller or a custom controller, but not both.

Don't worry though, there's a simple solution. While you cannot use both a standard controller and custom controller, you can extend either of them with a controller extension. As you probably guessed, an extension is just an Apex class that follows certain syntax. Extensions really do allow you to have ...

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