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
Dippan PatelDippan Patel 

Open Standard Lightning Convert Lead popup

Hi All, 

I have a visualforce page with Lightning UI. There is a "Convert Lead" link in this page. 

When clicked on this link, it is supposed to open native salesforce convert functionality. (Code below)
 
url = '/lead/leadconvert.jsp?id=' + recordId 

 if( (typeof sforce.one != 'undefined') && (sforce.one != null) ){
                if(recordId != null && recordId != ''){
                    sforce.one.navigateToURL(url);
                }
} 

else if(sforce.console.isInConsole()){
                sforce.console.openPrimaryTab(null, url, true);
}

 else {
      window.open(url);
  }



In Lightning Mode, it opens a classic visualforce page. How do I open Lightning Convert Popup (Standard)? 
SwethaSwetha (Salesforce Developers) 
HI Dippan,
Have you ensured the VF has the checkbox "Available for Lightning Experience, Lightning Communities, and the mobile app" enabled?

Similar ask: https://trailblazers.salesforce.com/answers?id=9063A000000e3YcQAI
If this information helps, please mark the answer as best. Thank you
Bhumi BhalodiyaBhumi Bhalodiya
Hi Dippan,
If you are able to solve this then please post your answer here.
I am posting a solution which is I have used. If anyone stops on this page then this solution may help.
As i know, It's not possible to open the lightning convert popup from any component.
But we can open the convert lead page instead.

This is the URL if anyone wants to use: /lightning/cmp/runtime_sales_lead__convertDesktopConsole?leadConvert__leadId=' + recordId
sfdcBaseURL;
renderedCallback() {
        this.sfdcBaseURL = window.location.origin;
}
convertLead(){
      let convertLeadURL = this.sfdcBaseURL + '/lightning/cmp/runtime_sales_lead__convertDesktopConsole?leadConvert__leadId=' + this.recordId;

      window.open(convertLeadURL, "_blank");
}


This is the solution to open the lead convert option in the same window:
 
convertLead(){
        this[NavigationMixin.Navigate]({
            type: 'standard__component',
            attributes: {
                componentName: 'runtime_sales_lead__convertDesktopConsole'
            },
            state: {
                leadConvert__leadId: this.recordId
            }
        });
}
This is LWC solution.
 
m k18m k18
@Bhumi Bhalodiya can you step by step please