O'Reilly logo

The Developer’s Guide to the Force.com Platform by Phil Choi, Andrew Fawcett, Glen Martin, Rick Greenwald

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

Saving the Position Record

Now, did you forget anything? Oh yes, you still have to save the Position__c record, the main focus of the page.

You don’t want to do anything extraordinary with this record—simply take the standard actions to save the record. You can simply call the default save action for the standard controller to accomplish this task.

Except for one little problem. Remember, the save method in your extension overrides the save method for the standard controller. If you call the default save method, you find your code in an endless loop.

You can escape this problem by declaring another instance of the standard controller and then calling the save method on that instance.

7.
Add the following code to the beginning of your class ...

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