+ Start a Discussion
kkr.devkkr.dev 

Override a standard button with Visualforce and Running round and round in circles

Hi All,

 

I am overrriding the standard New button on Account with vf page.Its running into infinite loop.

 

<apex:page standardController="Account" extensions="newvsold" action="{!pageredir}">

</apex:page>

 

public class newvsold
{

public newvsold(ApexPages.StandardController controller)
{

}
public Pagereference pageredir()
{
    Pagereference newpage = new Pagereference ('/001/e?acc2=test&retURL=/001/');
    return newpage;
}
}

 

 

Any thoughts?

 

Thanks

Best Answer chosen by Admin (Salesforce Developers) 
kkr.devkkr.dev

public class newvsold
{

public newvsold(ApexPages.StandardController controller)
{

}
public Pagereference pageredir()
{
   Pagereference newpage = new Pagereference ('/001/e?acc2=test&retURL=/001/');

   newpage .getParameters().put('nooverride', '1');
   newpage .setRedirect(true);   

   return newpage;
}
}