+ Start a Discussion
Marco JanmaatMarco Janmaat 

How to add "Convert" button to listview of leads in salesforce lightning

Hi All,

I'm looking for a way to add the "Convert" button to the listview of the leadpage. Anybody any idea how to do this?User-added image
Yogendra JangidYogendra Jangid
Hi Marco,
You have to create a custom list button for this with the name as Convert.
To know how to create a custom list please follow this link
https://salesforceoke.blogspot.com/2019/12/salesforce-lightning-list-button.html#:~:text=Go%20to%20object%20manager%20tab,an%20action%20in%20a%20controller.

if this helps please can you mark this as best answer for future reference. Thanks
Yogendra JangidYogendra Jangid
you can also follow below trailhead link to know more on custom list button.
https://trailhead.salesforce.com/en/content/learn/modules/lex_customization/lex_customization_buttons_links
Marco JanmaatMarco Janmaat
Thanks for your reply!

So I'm at the point where I can add a custom button, but my issue is, what type of "code" do I need to add there that has the same function as the "Convert" button on the detail page.

I can pick URL. Which I don't think is right.
I can pick On-Click Javascript. Is that the correct one?
I can can pick Visual Force Page. Should I add some visual force code first and then request it from the button?

Thanks
Yogendra JangidYogendra Jangid
Hi Marco,
you can choose any of the options and need to do the coding to make it work. 
but for your best use case to replicate Convert of lead, yes go with on click javascript and call an apex class from there.
if this helps please can you mark this as best answer for future reference. Thanks
Suraj Tripathi 47Suraj Tripathi 47
Hi 
Marco Janmaat
If you want to add a convert button in leads please follow these step:
Step 1:- Firstly click on setup
Step 2:- write leads in the quick find box.
Step 3:- select lead list and select on edit.
Step 4:-> after that Accept the default settings in the Standard Buttons section.
Step 5:-> and in a custom buttons action and click the right arrow to add the Convert to the Patient button.
Step 6-> last step to save. 
Please mark it as the best answer if it helps you to fix the issue.

Thank you!
Regards,
Suraj Tripathi
Marco JanmaatMarco Janmaat
Hi Suraj,
I clicked on setup. I typed in leads in the quick find box. But it doesn't show leadlist.
I have:
"Marketing"
  • Automatig reaction generation for leads
"Linkedin lead generation"
  • Linkedin account
  • Fields for the generation of leads
"Sale"
Settings for social accounts and contactpersons
Marco JanmaatMarco Janmaat
@Yogendra,. Do you have any example code I could use for it?
Thanks
 
mukesh guptamukesh gupta
Hi Macro,

To convert a Lead, the User(I mean his or her own Profile) needs all these Permissions:
  • “Create” and “Edit” on leads, accounts, contacts, and opportunities AND
  • “Convert Leads” AND
  • “Read” on any related campaigns
You'll need to verify that.

Also, verify that the button is on the page layout they are seeing (from Setup, not from their actual screen). If the button is there but they don't see it when they look at the Lead:

Edit their profile and make sure the "Convert Leads" permission under General User Permissions is checked.

You can check the convert leads permission info from the below help document.
  • https://help.salesforce.com/articleView?id=leads_convert.htm&type=0

if you need any assistanse, Please let me know!!


Kindly mark my solution as the best answer if it helps you.

Thanks
Mukesh
Marco JanmaatMarco Janmaat
Hi Mukesh,

Thie issue is not that they cannot convert it.
The issue is that I would like to have a button in the listview. Not in the detail page.

Thanks
 
SwethaSwetha (Salesforce Developers) 
HI Marco,
There is no standard functionality provided by salesforce to have the convert button on lead that mass converts the leads from the list view.

You will need to write custom code for this conversion functionality and call it via the custom button.

Posting few relevant articles that should help you get started:
>https://salesforce.stackexchange.com/questions/217351/open-lead-convert-page-in-lightnin-using-quick-action
>https://salesforce.stackexchange.com/questions/56307/replicating-the-convert-lead-button
>https://www.sfdcamplified.com/2020/03/custom-lead-conversion-in-lightning-web-component.html
>https://salesforce.stackexchange.com/questions/271624/i-want-to-convert-lead-into-account-contact-and-opportunity-by-clicking-on-custo

If this information helps, please mark the answer as best. Thank you
Suraj Tripathi 47Suraj Tripathi 47
Hi Marco,
Please visit this link for your reference.
https://help.salesforce.com/articleView?id=sf.einstein_sales_setup_enable_lead_insights.htm&type=5

Please mark it as the best answer if it helps you to fix the issue.
Thank you!
Regards,
Suraj Tripathi