function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
JDevJDev 

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);

}

 

 

Message Edited by JDev on 01-12-2010 04:33 PM