There are a number of “Black Box” processes in Salesforce that are essentially hardcoded functions that you have little or no control over. The out-of-the-box Lead Conversion process is one of these Black Box processes – when you click the standard ‘Convert’ button from a Lead record, you get redirected to a page called leadconvert.jsp.
While the standard page used for lead conversion is good enough most of the time for most customers, you may eventually find yourself asking, “How do I customize the Convert Lead screen?”
What are the use cases for a custom Convert Lead page for converting Salesforce leads?
- Include additional Opportunity, Account or Contact fields when converting a Lead
- Hide fields on the Convert Lead page
- Prevent users from creating new Opportunities when converting a Lead
- Remove the Task fields from the Convert Lead page
- Include additional custom buttons on the Convert Lead page
- Add or remove sections and manage the style and formatting of the Convert Lead page
- Implement custom or complex field mapping logic
- Map Lead fields to multiple fields on the converted Opportunity, Account or Contact
- Select an Account or Opportunity Record Type when converting a Lead
- Redirect to a different object or screen after converting a Lead
- Include a custom update on the Chatter feeds for converted records
- Add Products to Opportunities at the time of lead conversion
- Include logic to set default options and values when converting Leads
- Copy Lead field values to custom objects upon conversion
How does the custom Convert Lead page work?
We studied how the standard Salesforce Lead conversion process worked from end-to-end, and built an exact replica of the Convert Lead page using Visualforce and Apex. The result is an unmanaged package of Apex classes, custom Visualforce components, and a Visualforce page that you can use as a starting point for customizing the lead conversion process to the exact requirements of your business users.
The Convert Lead unmanaged package contains the following components:
- leadConvertPage – The Visualforce page that replicates the standard Convert Lead page and uses the Standard Controller for the Lead sObject
- leadConvertCoreComponent – Visualforce component containing the core UI elements for the Visualforce page
- leadConvertTaskDescriptionComponent – Visualforce component containing UI elements related to the Task Description
- leadConvertTaskInfoComponent – Visualforce component containing UI elements related to the common Task fields
- leadConvertPageHeaderTextComponent – Visualforce component containing text that appears at the top of the Visualforce page
- ComponentControllerBase – Core Visualforce component controller
- DateTimeUtility – Utility class containing Date / Time functions
- leadConvertController – Visualforce controller extension
- leadConvertCoreComponentController – Controller for the leadConvertCoreComponent Visualforce component
- leadConvertTaskDescComponentController – Controller for the leadConvertTaskDescriptionComponent Visualforce component
- leadConvertTaskInfoComponentController – Controller for the leadConvertTaskInfoComponent Visualforce component
- PageControllerBase – Helper class to manage communications between the Visualforce page and components
- TestLeadConvertPage – Unit tests for all Apex classes in the Convert Lead package
How do I use the custom Convert Lead page?
Implementing the custom Visualforce page is straightforward. You can choose to use either a standalone Custom Button (an example is included in the package) or overwrite the standard Convert button on the Lead object.
To use the Custom Button, simply drag it onto the desired Page Layouts from the Page Layout editor and optionally remove the standard Convert button from the page.
To override the standard Convert button, navigate to ‘Buttons, Links, and Actions’ in the Customize options for the Lead object. Click the ‘Edit’ link next to the Convert button, set the ‘Override With’ option to ‘Visualforce Page,’ and select the ‘leadConvertPage’ Visualforce page from the dropdown menu.
Where can I find the Convert Lead unmanaged package?
You can use the following link to the private AppExchange listing to download the app into your Unlimited Edition, Enterprise Edition, or Developer Edition org:
Something to keep in mind – because this is an unmanaged package, updates to the package will not be applied to any Salesforce orgs in which the package is installed. We will be updating the package regularly based on feedback from the community, so when you see an update available you can download it, but you will need to manually apply any changes to your customized version of the application.