+ Start a Discussion
Meryem FRQMeryem FRQ 

How to redirect from a standard page ?

I need to overwrite the standard edit page for a certain recordType of events. Any ideas how to redirect to the new VF page ?
Best Answer chosen by Meryem FRQ
ShashankShashank (Salesforce Developers) 
Please see if this helps: http://blog.deliveredinnovation.com/2009/08/09/force-com-tip-new-button-override-to-assign-visualforce-page-to-specific-record-type-using-native-apex-code/

All Answers

ShashankShashank (Salesforce Developers) 
Please see if this helps: http://blog.deliveredinnovation.com/2009/08/09/force-com-tip-new-button-override-to-assign-visualforce-page-to-specific-record-type-using-native-apex-code/
This was selected as the best answer
Meryem FRQMeryem FRQ
Perfect. Thank you so much !!
Vishal NegandhiVishal Negandhi
The above blog is a good option, but you can also do it by creating a new custom edit button and adding it on layout and removing the standard edit button. 
Small example:
- the below code is for an edit custom button, it redirects to new account page for a recordtype and for all others, it redirects to a new contact page

var recTypeId = '{!Account.RecordTypeId}';
alert(recTypeId );
if(recTypeId == '01290000001ADgY'){ alert('if');window.location="/001/e"; }
else {
alert('else');
window.location="/003/e";}