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
Adriana Smith 9Adriana Smith 9 

Need to create a lead from a contact record.

Need to create a lead from the contact record, where Name, Title, Company, email, and Address information is copied over.  Can someone help create this button?  I'm not sure where to even start.
Best Answer chosen by Adriana Smith 9
Leo10Leo10
follow these steps
1. Go to setup
2.Click Customize from left side panel
3.Click contact drop down
4.Click Buttons, Links & Actions
5.Click new button or link
6. Name Label (eg. Clone/convert to lead)
7. Enter a description (eg. Clone contact details into new lead form)
8. Paste in link below into syntax box
https://na1.salesforce.com/00Q/e?name_salutationlea2={!Contact.Salutation}&name_lastlea2={!Contact.LastName}&name_firstlea2={!Contact.FirstName}&lea8={!Contact.Phone}&lea3={!Account.Name}&lea11={!Contact.Email}&lea4={!Contact.Title}&lea16street={!Contact.MailingAddress}&lea16city={!Contact.MailingCity}&lea16state={!Contact.MailingState}&lea16country={!Contact.MailingCountry}&lea16zip={!Contact.MailingPostalCode}&lea9={!Contact.MobilePhone}&lea10={!Contact.Fax}&lea12={!Account.Website}. 
9. Check syntax
10. Click Save
11. Go to contacts tab and select a contact (to see it in action)
12. Click Edit Layout - Top right hand screen
13. Add your link/button in the custom links section
14.Review your lead form and save

All Answers

Leo10Leo10
Ramssf70Ramssf70
Hi Adriana Smith,
you  need to create buttton in lead object then go to Customize--->Leads-->Buttons, Links, and Actions-->then you can create a button from there  after creating button you need to add to pagelayout .you can add the that button where ever you want in the page layout .after creating button you need to write apex code for  creating a  contact record  from lead object...
Adriana Smith 9Adriana Smith 9
Nabeel, that doesn't populate with any information from the lead, though.  They still have to enter it all over again.  Kakarla, yes, that's what I want to do, but I need help writing the apex code.
Leo10Leo10
follow these steps
1. Go to setup
2.Click Customize from left side panel
3.Click contact drop down
4.Click Buttons, Links & Actions
5.Click new button or link
6. Name Label (eg. Clone/convert to lead)
7. Enter a description (eg. Clone contact details into new lead form)
8. Paste in link below into syntax box
https://na1.salesforce.com/00Q/e?name_salutationlea2={!Contact.Salutation}&name_lastlea2={!Contact.LastName}&name_firstlea2={!Contact.FirstName}&lea8={!Contact.Phone}&lea3={!Account.Name}&lea11={!Contact.Email}&lea4={!Contact.Title}&lea16street={!Contact.MailingAddress}&lea16city={!Contact.MailingCity}&lea16state={!Contact.MailingState}&lea16country={!Contact.MailingCountry}&lea16zip={!Contact.MailingPostalCode}&lea9={!Contact.MobilePhone}&lea10={!Contact.Fax}&lea12={!Account.Website}. 
9. Check syntax
10. Click Save
11. Go to contacts tab and select a contact (to see it in action)
12. Click Edit Layout - Top right hand screen
13. Add your link/button in the custom links section
14.Review your lead form and save
This was selected as the best answer
Adriana Smith 9Adriana Smith 9
All worked except I'm getting the error message as "invalid country code" and "invalid state code"?  Is this because I have picklists enabled?
Josh Delaney 9Josh Delaney 9
Hi Adriana,

A bit late to the party but I have the same issue as you and also suspect it's before of State/Country Picklists. Did you ever find a solution?
Adriana Smith 9Adriana Smith 9
Nope!
Josh Delaney 9Josh Delaney 9
Hi,

If anyone else has this issue (you will with the formula above if you use State/Country picklists), you must replace {!Contact.MailingAddress} with {!Contact.MailingStreet} - worked for me!
Adriana Smith 9Adriana Smith 9
Nope, didn't map the Country or State for me.  This is the code I'm using:

https://na1.salesforce.com/00Q/e?name_salutationlea2={!Contact.Salutation}&name_lastlea2={!Contact.LastName}&name_firstlea2={!Contact.FirstName}&lea8={!Contact.Phone}&lea3={!Account.Name}&lea11={!Contact.Email}&lea4={!Contact.Title}&lea16street={!Contact.MailingAddress}&lea16city={!Contact.MailingCity}&lea16state={!Contact.MailingState}&lea16country={!Contact.MailingCountry}&lea16zip={!Contact.MailingPostalCode}&lea9={!Contact.MobilePhone}&lea10={!Contact.Fax}&lea12={!Account.Website}