You need to sign in to do that
Don't have an account?

Redirecting up a {!save} w/ controller extension
Hi all,
Thanks for your help - many times in the past! I'm trying to redirect a user once a form has been saved... following the code example in the Developer's guide (p.393), but I'm getting an error:
Class.appLessonExtension.save: line 27, column 22 External entry point
with this controller extension, which seems to be correct to me?
public class appLessonExtension { private final Lesson_Plan__c lessonplan; private final ApexPages.standardController theController; ... public PageReference save() { PageReference pageRef = new PageReference('CTN_Apprenticeship'); pageRef.setRedirect(true); try { return theController.save(); } catch (DmlException e) { ApexPages.addMessages(e); } return pageRef ; } }
what about this:-
try {
theController.save();
}
catch (DmlException e)
{
ApexPages.addMessages(e);
return null;
}
R.
Is CTN_Apprenticeship a VF page? If so I think it'd be:
PageReference pageRef = Page.CTN_Apprenticeship
If non-VF page then:
PageReference pageRef = new PageReference('/CTN_Apprenticeship')
Hope that helps.