+ Start a Discussion
Sean PhanSean Phan 

Override lead convert button with lightning component

First question.  We wrote a lightning record page to customize the lead conversion process.  Is there a way to override the Lead "convert" button with the custom lightning component.  We were able to override the "new" button to use a custom lightning bundle component.  However, on the "convert" button, only the "visualforce page" override action exist.  

Second question.  In lightning lead path, when the "Mark Status as Complete" action for Converted is selected, it is launching the standard convert page even if the convert button is override with a visualforce page.  Is this a setup that can be changed?
Jefferson FernandezJefferson Fernandez
Hi Sean,
I have implemented this before and it seems that its a limitation as of now. So for you to override the Convert button, you will need to enclose your custom lightning component inside a visualforce page which can be found here (https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/components_visualforce.htm?search_text=visualforce).

For the Lead path buttons, I had to create a hidden checkbox (e.g. IsConvertedInApex) set to false as default. If false, there will be a validation error that will say "Please Use the Lead Convert Button" and will not allow them to change the status using the path buttons. They will be forced to use the overriden Convert button and launch your VF page. Then once it has been converted on your Lightning Apex Controller, set the value of the field to true so the validation message will not fire. If the sales path is still editable even it the Lead is converted, create a validation message that ensures that changes can't be made once it has been converted. https://salesforce.stackexchange.com/questions/181920/turning-converted-leads-to-read-only-on-lightning

I know this is a workaround and a hassle so you may want to upvote the idea here so SF could work on it. https://success.salesforce.com/ideaView?id=0873A000000E6tNQAS

Please mark as best answer if this solved your issue so to transfer your post to Solved Questions which in turn will help other users with same questions as well.

Thanks,
Jeff