You need to sign in to do that
Don't have an account?
Sergio Ruiz Barrios
Override New Account Button
Hi All,
I want to override the "New" standard button on the Account object with a visualforce in order to avoid the record type selection. I want to redirect it to the Account creation with the Record Type "Nuevo Account". The below code works fine for other object than Account, where it doesn´t load:
VISUALFORCE PAGE
<apex:page standardController="Account" Extensions="testpage" action="{!dotestpage}">
<apex:form >
</apex:form>
</apex:page>
APEX CLASS
public class testpage{
Account acct;
public testpage(apexpages.StandardController stdcontroller){
this.acct=(Account)stdcontroller.getRecord();
}
public PageReference dotestpage(){
PageReference pageRef = new PageReference('/003/e');
pageRef.setRedirect(true);
return pageRef;
}
}
Tanks for the help!
I want to override the "New" standard button on the Account object with a visualforce in order to avoid the record type selection. I want to redirect it to the Account creation with the Record Type "Nuevo Account". The below code works fine for other object than Account, where it doesn´t load:
VISUALFORCE PAGE
<apex:page standardController="Account" Extensions="testpage" action="{!dotestpage}">
<apex:form >
</apex:form>
</apex:page>
APEX CLASS
public class testpage{
Account acct;
public testpage(apexpages.StandardController stdcontroller){
this.acct=(Account)stdcontroller.getRecord();
}
public PageReference dotestpage(){
PageReference pageRef = new PageReference('/003/e');
pageRef.setRedirect(true);
return pageRef;
}
}
Tanks for the help!
1) https://developer.salesforce.com/forums/?id=906F000000094WRIAY
2) http://salesforce.stackexchange.com/questions/27835/how-can-i-override-the-record-type-selector-and-still-use-the-standard-new-pag
3) http://salesforce.stackexchange.com/questions/89091/how-to-override-the-standard-page-only-for-specific-record-type
Please try to update button URL and pass recordType in URL