There are instances where we need to pass specific settings/values to the Lead Conversion page. For example, we may want to check off the "Do not create a new opportunity upon conversion." checkbox by default when a user clicks on the Convert button. Let's get to it.
1. Step one is to create a custom button to replace the standard "Convert" button. Click on:
Setup | Customize | Leads | Buttons and Links | New
2. Enter the required information. See image below
3. Enter the following code in the formula field:
window.location.href="/lead/leadconvert.jsp?nooppti=1&sem=1&tsk5_fu='Contact New Lead: {!Lead.LastName}&tsk4_fu={!Today()+3}&tsk13_fu=High&tsk12_fu=In Progress&id={!Lead.Id}&RetURL=/{!Lead.Id}";
The custom Convert button now does the following:
- Checks off the "Do not create a new opportunity upon conversion." (nooppti=1)
- Passes the Task Subject value for the task (tsk5_fu)
- Passes the Task Due Date of the Task (tsk4_fu={!Today()+3})
- Passes the Task Priority value (tsk13_fu=High)
- Passes the Task Status value (tsk12_fu=In Progress)
Here are all of the page elements (fields) and their respective id's:
- Send Email to Owner: sem
- Opportunity Name: noopptt
- Converted Status: cstatus
- Priority: tsk13_fu
- Status: tsk12_fu
- Comments: tsk6_fu
- Send email notification: email_followup
- Reminder: IsReminderSet_fu
- Reminder Date: reminder_dt_fu
- Reminder Time reminder_dt_fu_time
Don't forget to add your new button to your desired page layout(s). Enjoy.
Can't thank you enough Javier!! Didn't know how to reply back to you from the answer on SFDC site but you are a lifesaver.. plus I've got this blog as a resource as well!
ReplyDeleteLeAnn Scott
I'm very happy to hear that LeAnn. By the way, if you ever need reply to a question/answer on the Answer Community, all you have to do is login, click on your name at the top and then click either questions or answers on the left menu. This will allow you to locate the specific entry and then you can reply.
ReplyDeleteHi Javier!
ReplyDeleteJust a quick question on this - I have a customer who is concerned that by using this, if Salesforce were to ever move their org to a different server, that it would "break" this functionality. Do you know if that would happen? And what the odds would be that SFDC would move them?
Thanks so much for your help, yet again!
LeAnn
This would not be an issue with this specific example. You can test it by implementing it and then refreshing a sandbox or implementing it on a sandbox. If you look at the link, you can see that I don;t specify the Salesforce.com server.
ReplyDeleteThis is great. Is there a way to set the converted status too? I don't see that parameter listed.
ReplyDeleteYup...try id = cstatus
ReplyDeleteJavier,
ReplyDeleteThis is awesome. Do you know what the id is for a task type picklist... and how to find out what it would be or a comprehensive list of id's?
Thanks!!!
Chris
Christopher,
ReplyDeleteTry tsk10_fu. For me, the easiest way to find out that the id of the field is to use Google Chrome as your browser. Go to the page where the field is displayed and right click on the filed. Then select Inspect Element and viola!
Christopher, the comment above assumes that you are talking about the Type field on the Task object. If you're not referring to this field, just use my method for finding the id. Good luck.
ReplyDeletereminder_select_check <== not work
ReplyDeleteIsReminderSet_fu <== work
Thanks! I must have copy/pasted the wrong value. Fixed now.
ReplyDeleteYay!!! Thank you!
ReplyDeleteGreat Post! I tried adding cstatus=Sales%20Qualified parameter I get the following error on clicking the convert button on leadconvert.jsp page. Can you say why i keep getting this?
ReplyDelete"
Unable to Access Page
The value of the "cstatus" parameter contains a character that is not allowed or the value exceeds the maximum allowed length. Remove the character from the parameter value or reduce the value length and resubmit. If the error still persists, report it to our Customer Support team. Provide the URL of the page you were requesting as well as any other related information. "
Can you post the entire URL that results from you clicking the Convert button?
ReplyDeleteHi Javier, we tried to set this too, as we wanted the default to be "qualified" but got the same error message. I did notice that it seemed to create a 2nd value called "qualified" in addition to the one on the picklist. Were you able to resolve this for Siri?
DeleteThanks!
Can you post the entire URL that results from you clicking the Convert button?
Deletehttps://na3.salesforce.com/lead/leadconvert.jsp
DeleteUnable to Access Page
The value of the "cstatus" parameter contains a character that is not allowed or the value exceeds the maximum allowed length. Remove the character from the parameter value or reduce the value length and resubmit. If the error still persists, report it to our Customer Support team. Provide the URL of the page you were requesting as well as any other related information.
Can I integrate custom fields to the form?
ReplyDeleteUnfortunately no. You would have to create your own VF Lead Convert page.
DeleteAny chance you can get the lead conversion page to direct to a different page other than the converted account page after submission
ReplyDeleteUnfortunately I don;t think there's a simple way to do it. You would need to override the Convert button on the lead screen to take you to a custom VF Lead Convert page that would redirect you to your desired page after the convert process takes place.
ReplyDeleteIs there a way to hide certain task fields on the same page?
ReplyDeleteUnfortunately not without having to override the Lead Conversion page with your own custom Visualforce page.
ReplyDeleteThanks for your article, this really helped me a lot. I have a question...can we default recordtype for new accounts through this LeadConvert.jsp? If yes, then what should be the parameter name. Once again thanks..
ReplyDeleteUnfortunately I don;t think you can, since everything we are passing in the custom button is actually being captured on the conversion page form fields.
ReplyDeleteTake a look at this free app and see if it fits your requirements.
Lead - Smart Convert 2.0
http://appexchange.salesforce.com/listingDetail?listingId=a0N30000007qq0iEAA
Javier,
ReplyDeleteThanks for the hack.
Hi Javier is it possible to set up the URL to default the Account name pick-list to say Attach to Existing:... I've setup 2 lead record types (New Lead) (Existing Lead). The Existing lead page layout has an Account lookup field which creates a relationship to the Account. I use a WF to update the Company field to the exact name which is on the Account lookup. When it's ready to covert - it then has a high probability of it matching to Existing Account upon conversion. Do you have the code for that field?
ReplyDeleteMany thanks!!
I'm not sure. Try adding the following to your link:
ReplyDelete&accid=AccountNameGoesHere&acclkid_lkid=AccountIDGoesHere
Thanks Javier by luck I searched "acclkid_lkid=" in google and found another blog. It explains you need to add in the your lookup Id 3 times. The extra code is "acclkid_lkwgt=" . Together with this and setting up another custom New button on the Lead related list on the Account page it's quite seemless. http://techman97.wordpress.com/tag/professional-edition/
ReplyDeleteThanks again mate.
We’re using the NPSP and we created a new custom “Convert” button using >> window.location.href="/lead/leadconvert.jsp?nooppti=1&id={!Lead.Id}&RetURL=/{!Lead.Id}"; << from your answer on http://goo.gl/cohrY and it DID work perfect but ONLY if you uncheck the ”Overridden” option on the default NPSP Convert button (leadConvertOverride [npe01__leadConvertOverride] (Visualforce Page)). My concern is if we do not use the default NPSP Convert button that we might lose some NPSP lead conversation custom process. Do you have any insight or answers?
ReplyDeleteThanks Javier!
Hi Mark,
ReplyDeleteUnfortunately I don't have enough experience with the NPSP edition to know what the ramifications would be.
I am using this window.location.href="/lead/leadconvert.jsp?sem=0&noopptt={!Lead.FirstName}+{!Lead.LastName} - +{!Lead.Due_date__c}&tsk4_fu={! Lead.Due_date__c }&tsk13_fu=High&tsk12_fu=In Progress&id={!Lead.Id}&RetURL=/{!Lead.Id}"; to populate 'Customer Name - due date' as new opptunity Name, Can I format the first Due_date_c field to mmddyy without the slashs. Please Advise.
ReplyDeleteThank You
I want to completely disable that option to check.Can I pass any parameter in url like we did for checking it!!!
ReplyDeleteUnfortunately no. The only way to prevent it is to completely replace the conversion page with a custom VF page. Requires considerable amount of experience with Apex and VF.
DeleteHow can we hack 'Save & new task' standard button? While clicking on this button I am losing the custom fields value which I have pre-populated for a standard task edit page from a custom button. Any help is much appreciated.
ReplyDeleteNice post Javier, just used this : )
ReplyDeleteThanks Sharif! Happy to help!
DeleteIs there any further reading you would recommend on this?
ReplyDeleteAmela
Lead conversion
Hi, I would like to just rename the convert button. I'm really bad with code stuff so I tried to modify your code in order to make the button redirect to leadconversion page:
ReplyDeletewindow.location.href="/lead/leadconvert.jsp?retURL=%2F{!Lead.Id}"
Of course is not working because I don't know what's missing.
Can you help me with this?
Thanks on advanced!
Is there a way to have this convert page open in the Lightning UI? Currently, the page opens in the Classic view.
ReplyDeleteNice blog..!
ReplyDeleteRead More How to Qualify a Lead in Under a Minute.How to Qualify a Lead
Hi,
ReplyDeleteI am trying to use this formula for a similar requirement but I am getting en error that the URL does not exist.
ReplyDeletehacks snapchat
hack into snapchat
Event Lead Capture I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article.
ReplyDeletecan the default record type be changed fro account and opportunity ?
ReplyDeleteI have requirement where in the convert screen i want to pre populate the record type based on lead record type in the account and opportunity.. which parameter or mapping i can use. Also want to remove the button do not create opportuntiy.
ReplyDelete