• m k18
  • NEWBIE
  • 0 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
  i have created the button but it is going to classic not lightning url :/lead/leadconvert.jsp?retURL=%2F{!Lead.Id}&id={!Lead.Id}&nooppti=1 this is url i have used in button  any suggest how to redirect to lightning convert button

this page need to open 

User-added image
  • January 20, 2022
  • Like
  • 0
Public class ProspectContactCntrl
{
    Public List<SelectOption> recTypeLst {set;get;}
    Public List<RecordType> recLst {set;get;}
    public string selRecordType {set;get;}
    public String contactId {set;get;}
    public String leadId {set;get;}
    public String contactName {set;get;}
   public ProspectContactCntrl(ApexPages.StandardController stdController) { 
     recTypeLst = new List<SelectOption>(); 
     recLst = new List<RecordType>();  
       recTypeLst.add(new SelectOption('','---Select---'));
    List<RecordTypeInfo> infos = Prospect__c.sobjectType.getDescribe().getRecordTypeInfos();
    set<id> recTypeIdLst = new Set<Id>();
    // List<RecordType> recLst =  [select id,name from RecordType where sobjectType = 'Prospect__c' and isActive = true];
    for(RecordTypeInfo rec : infos)
    {
        if(rec.isAvailable() && !rec.isMaster()){
            recTypeLst.add(new SelectOption(rec.getRecordTypeId(),rec.getName()));
            recTypeIdLst.add(rec.getRecordTypeId());
        }
        
    }
   recLst =  [select id,name,Description from RecordType where id=:recTypeIdLst and sobjectType = 'Prospect__c' and isActive = true];     
   leadId = System.currentPageReference().getParameters().get('ldId');   
   contactId = System.currentPageReference().getParameters().get('conId');
    if(contactId != null)
    {
      Contact con = [select id,name from contact where id=:contactId];
      contactName= con.name;        
    }
        
  }
  • December 24, 2021
  • Like
  • 0
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)?