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
sfadm sfadmsfadm sfadm 

Default the Opportunity screen after Lead conversion

Hello,

I have a custom vf page which is controlling the conversion process from Lead to Account. What I'd like to achieve is that once I convert the system to automatically redirect to the opportunity page. Could you please advise how this can be achieved?
Best Answer chosen by sfadm sfadm
sfadm sfadmsfadm sfadm
I've found a solution in https://success.salesforce.com/answers?id=9063A000000l4LlQAI
Thanks for your help anyway.

All Answers

Sumeet_ForceSumeet_Force
have your method return the PageReference class instance and pass appropriate opportunity URL. that should suffice.
HARSHIL U PARIKHHARSHIL U PARIKH
You ned to create a Method (e.g., PageReference) and have that method returns the opportunity page.
Something like below:
Public PageReference GoToOpportunityPage()
{
    PageReference p = new PageReference('https://na40.salesforce.com/006/o');
    return p;
}
Now you need to call this Method GoToOpportunityPage on visualfore page on appripriate button.
Something like below:
<apex:commandButton value="Go To Opportunity" action="{!<b>GoToOpportunityPage</b>}"/>
Hope it helps and mark it solved if it solves the query.
 
sfadm sfadmsfadm sfadm
Unfortunately the
<apex:commandButton
is not mine. I'm using the standard Salesforce "Convert" button.
To clarify what I want to achived is the following:
How from the standard conversion page /lead/leadconvert.jsp?id=someID&nooppti=0&nooverride=1&retURL=%2FsomeOtherID I can redirect to Opportunity when pressing the "Convert" button?
 
Sumeet_ForceSumeet_Force
in this case...usuallly....retURL does the trick however here....the optyID is yet to get generated...and thus you would either need another custom CONVERT button (that would internally handle redirection) or else have some logic on Account page post redirection that would re-direct to Opty if its a fresh lead conversion record.
sfadm sfadmsfadm sfadm

Hello,

Thank you for your answers but I have two questions: 

First, it is no clear if I make such CONVERT button how to connect it to the leadconvert.jsp standard converting page because CONVERT button must have the functionality of the standard CONVERT button as well as to redirect to the Opportunity standard page?

and

Second, once the Lead is converted where and how to get the sorce code of the page of the newly created Account in order to modify the code and make the redirect to Opportunity possible?

sfadm sfadmsfadm sfadm
I've found a solution in https://success.salesforce.com/answers?id=9063A000000l4LlQAI
Thanks for your help anyway.
This was selected as the best answer