You need to sign in to do that
Don't have an account?
Jay Liladhar
Redirect Account 'New' button to New lead edit page visualforce
Hi,
I am trying to use VF to redirect to a new lead edit page when clicking on the 'New' button on the Accounts tab.
Not sure how to go about this, please advise.
Thanks,
Jay
I am trying to use VF to redirect to a new lead edit page when clicking on the 'New' button on the Accounts tab.
Not sure how to go about this, please advise.
Thanks,
Jay
Thanks,
Srinath
One way is to use the attribute "action" on the <apex:page> tag, and call your controller method which would redirect to the new lead URL
Page:
<apex:page standardController="Account" extension="CustomClass" action="redirectPage">
.......
</apex:page>
Extension Class:
public class with sharing CustomClass(){
public PageReference redirectPage() {
PageReference leadPage = new PageReference('/00Q/e?retURL=%2F00Q%2Fo&RecordType=' + [ID of Record Type if any] + '&ent=Lead');
leadPage.setRedirect(true);
return leadPage;
}
public CustomClass(){
}
}
This code is just indicative. Please try and fix any possible issues.
Thanks,
Srinath