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
finalistfinalist 

Is it possible to co-opt 'Convert Lead' functionality, leaving existing Convert button as is?

Is it possible to access the functionality of the Lead Convert button without overriding the button itself, if I want to provide an alternative way to handle certain business processes?

Is it simply a matter of taking the Lead Id from the Lead and redirecting to the 1st conversion page?
Code:
https://na5.salesforce.com/lead/leadconvert.jsp—retURL=%2F(LeadId)&id=(LeadId)

// parens inserted in above ^ line for emphasis only; no actual need for them

 There are a few steps to update some fields in the Lead before I passed it on, but otherwise it's just a standard process.

I suppose one option would be to override the Convert button and call it 'Accept/Convert', and depending on whether 'Submitted' = True, I either do my update and then convert, or just convert.

For those Sales Reps who aren't affected, though, I'd rather not have to explain what 'Accept/Convert' is; I'd rather just say "You guys just ignore the new 'Accept Lead' button; you,on the other hand, need to use this new process.'

Thanks!

finalistfinalist
As luck would have it, I have solved my own question - I created a separate Button on the Lead layout that I'm using, and inserted the url of the landing page where I ended up after clicking 'Convert' on the lead.  If you click 'Convert', there's no change; if you click the new button and substitute in the Lead.Id, the fields are updated and the Lead Process begins, as if you'd changed the field values and hit save before hitting 'Convert'.

This bit of code also includes code to check whether the starting page was inside of the Console, or was just inside the standard Leads tab:
Code:
if(window.parent.location.href=="https://na2.salesforce.com/ui/desktop/DesktopPage") 
{ 
var finishedLocation = "/lead/leadconvert.jsp—retURL=%2F{!Lead.Id}&id={!Lead.Id}&isdtp=mn"; 
} 
else 
{ 
var finishedLocation = "/lead/leadconvert.jsp–retURL=%2F{!Lead.Id}&id={!Lead.Id}"; 
}; 

// I set my updated fields outside of this snippet; 
// finishedLocation is just where I end up.

window.location = finishedLocation; 

 Now, where'd I put that code that replaces my need to hard code na2.salesforce.com ...



Message Edited by finalist on 08-12-2008 03:33 PM
StanleyHStanleyH

Thanks for sharing!

 

I copied your code over like this:

<script type="text/javascript">

if(window.parent.location.href=="https://na5.salesforce.com/ui/desktop/DesktopPage")
{
var finishedLocation = "/lead/leadconvert.jsp—retURL=%2F{!Lead.Id}&id={!Lead.Id}&isdtp=mn";
}
else
{
var finishedLocation = "/lead/leadconvert.jsp–retURL=%2F{!Lead.Id}&id={!Lead.Id}";
}

window.location = finishedLocation;

</script> 

 

 

But here is the error I got, any clue on what I am missing? I tried both: overwrite Convert; and customer Button. Error:

URL No Longer Exists

You have attempted to reach a URL that no longer exists on salesforce.com.

You may have reached this page after clicking on a direct link into the application. This direct link might be:
• A bookmark to a particular page, such as a report or view
• A link to a particular page in the Custom Links section of your Home Tab, or a Custom Link
• A link to a particular page in your email templates

If you reached this page through a bookmark, you are probably trying to access something that has moved. Please update your bookmark.

If you reached this page through any of the other direct links listed above, please notify your administrator to update the link.

If you reached this page through a link on our site, please report the broken link directly to our Support Team and we will fix it promptly. Please indicate the page you were on when you clicked the link as well as any other related information. We apologize for the inconvenience.

Thank you again for your patience and assistance. And thanks for using Salesforce!