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
Prasanth Reddy MPrasanth Reddy M 

Account Redirect page for EDIT is working for VF pages but for standard layouts its returning home page.

Hi,
The bellow Account Redirect page for EDIT is working fine for VF pages but for standard layouts after editing the record it is not returning home page instead of account detail page.

Am i missing something here?
Pls suggest.
public with sharing class DispatcherAccounteditController {
public DispatcherAccounteditController(ApexPages.StandardController controller) {
        this.controller = controller;
    }

    public PageReference getRedir() {
Account acc = [Select id, recordtypeid From Account Where Id = :ApexPages.currentPage().getParameters().get('id')];

        PageReference newPage;

        if (acc.recordtypeid == '0123B000000Hs88') {
            newPage = Page.AccountEdt;
        } else {
            newPage = new PageReference('/' + acc.id +'/e');
            newPage.getParameters().put('nooverride', '1');     
        }
 			 newPage.getParameters().put('id', acc.id);
       
             return newPage.setRedirect(true);

    }
     
    private final ApexPages.StandardController controller;

}

 
Raj VakatiRaj Vakati
Did you override the edit button with this page ??  Please override the edit button with this page si that it will redirect 

How are you using this page ??