Convert Leads from Account Page

Business Problem

So you have the Leads related to Accounts based on the match between the Lead's email address domain and the Account's website domain. If you don't, check out this article on how to get the free app to automate this for you. Now your users want to convert Leads right from the Account page and of course, they want to convert more than one at a time!

We have added a new feature to the Relate Leads to Accounts free AppExchange package that will allow you to accomplish this. Version 1.2 of the Relate Leads to Accounts contains these new components:

  • Custom Convert (Custom List Button on Lead Object) - this button is used on the Lead related list on the Account page.
  • BN_CustomConvertLeadPage (VisualForce Page) - this page is called by the Custom Convert button when it is clicked and has an action that is called when the page loads. It also displays any error messages received from validation rules or duplicate rules.
  • BN_CustomConvertLeadController (Apex Class) - this class is invoked by the Custom Convert button via the VisualForce page action. The apex class has the method that will take all the selected leads and call the DML convert action for all of them and sends a failure message to the VisualForce page if an error occurs.
  • BN_CustomConvertLeadController_Test (Apex Class) - this is the test class for the CustomConvertLeadController class.

How to Configure the App

  1. Install the free app from the AppExchange and make sure to install for all of the profiles that will be using this.
  2. Go to Setup | Object Manager | Account | Page Layouts.
  3. Select the page layout you would like to add the custom button to and scroll down to the Leads related list. Click the wrench icon.

  1. Click the + sign in the Buttons section.

  1. Add the Custom Convert button the selected buttons section and click OK.

  1. Save your page layout.

That's it, now you are ready to start testing!

How It Works

  1. Hover over the Leads related list on the Account page.
  2. Check the boxes next to the Leads you want to convert.
  3. Click Custom Convert. You will now see your Leads in the Contacts related list on the Account.

Error Handling

If an error occurs with one of the Leads during the conversion process, you will receive a message that looks like this. In this example, there was a validation rule that required the Contact to have a zip code that matched the Account. The error message contains a link so the user can easily navigate back to the Account page.

For any questions, comments, concerns – let us know in the comment section below!
We would love to hear from you!

Share This Story, Choose Your Platform!

About the Author

Anjana Prakash

Anjana is a certified Salesforce developer and Technical Lead at Blu Ninjas. A passionate programmer with ninja skills in multiple programming languages, she has been solving challenging problems in a variety of industries on the Salesforce platform for more than 10 years.

2 thoughts on “Convert Leads from Account Page”

  1. Hi Anjana thanks for developing such tool. So proud . I need favor. Do we have same customization of converting mass leads on Lead it self rather having it on Account as related list. I need mass conversion on lead itself.

    1. Hi Naveen,

      We apologize for the delayed reply, comments have been disabled on our website and we are just seeing these. Unfortunately, we do not have a mass convert tool from the Lead object. We can put this on the list to build one day and reach out to you if we do!

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to Top