You need to sign in to do that
Don't have an account?
Problem with Page Redirect
We have a simple VF redirect page that overrides standard account edit to display a special visualforce page when a particular record type is selected but uses the standard edit page otherwise. This works fine, except that now we can't seem to change Record Types - when the Change Record Type link is selected the standard Edit Page opens up with the existing Record Type already saved. Controller Code page redirect is here
public PageReference gotoPage() {
Account acct = [Select id, RecordType.Name From Account Where Id =ApexPages.currentPage().getParameters().get('id')];
PageReference newPage;
if (acct.RecordType.Name == 'Special') {
newPage = Page.editSpecial;
} else {
newPage = new PageReference('/' + acct.id + '/e');
newPage.getParameters().put('nooverride', '1');
}
newPage.getParameters().put('id', acct.id);
return newPage.setRedirect(true);
}