• rk
  • NEWBIE
  • 0 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 5
    Replies
I want to open the lead convert page in Lightning,. Is their a solution for this Issue.
  • October 25, 2022
  • Like
  • 0
Hi.. I am new and learning salesforce. I wanted to create a custom Button in lightning.Upon clicking,they need to validate a field and only if true it has to open a visualforce page. I am able to do this using onclick javascript button,but i need it in lightning. I have added my javascript and visualforce page. Please guide me in this.

{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")} 
{!REQUIRESCRIPT("/soap/ajax/20.0/apex.js")} 

var type = "{!Opportunity.Type}"; 

if(type === 'Existing Customer - Downgrade'){ 
window.open('/apex/OppRenewal'); //to reload the window and show the updated values 

}else{ 
alert('Your not allowed.'); 

}


Visualforce Page Code

<apex:page standardController="Opportunity"  showHeader="true" standardStylesheets="true" sidebar="true">

   <apex:form id="mainform">
        <apex:pageMessages id="msgs"/>
 <apex:pageblock title="Quote Renewal">
                <apex:pageBlockButtons >
                <apex:commandButton value="Save" action="{!save}"/>
                <apex:commandButton value="Cancel" action="{!cancel}"/>
        </apex:pageBlockButtons>
    <apex:pageBlockSection title="Information" >
                <apex:outputfield value="{! Opportunity.name}"/>
                <apex:outputfield value="{! Opportunity.Type}"/>
                <apex:outputfield value="{! Opportunity.Amount}"/>
   </apex:pageBlockSection>
   <apex:pageBlockSection title="Contacts">
                 <apex:inputField value="{! Opportunity.Bill_to__c}" label="Bill TO"/>
   </apex:pageBlockSection>
</apex:pageblock>
            </apex:form>

</apex:page>


I tried to add the <script> but I am not able to achive it.
  • August 06, 2022
  • Like
  • 0
Hi.. I am new and learning salesforce. I wanted to create a custom Button in lightning.Upon clicking,they need to validate a field and only if true it has to open a visualforce page. I am able to do this using onclick javascript button,but i need it in lightning. I have added my javascript and visualforce page. Please guide me in this.

{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")} 
{!REQUIRESCRIPT("/soap/ajax/20.0/apex.js")} 

var type = "{!Opportunity.Type}"; 

if(type === 'Existing Customer - Downgrade'){ 
window.open('/apex/OppRenewal'); //to reload the window and show the updated values 

}else{ 
alert('Your not allowed.'); 

}


Visualforce Page Code

<apex:page standardController="Opportunity"  showHeader="true" standardStylesheets="true" sidebar="true">

   <apex:form id="mainform">
        <apex:pageMessages id="msgs"/>
 <apex:pageblock title="Quote Renewal">
                <apex:pageBlockButtons >
                <apex:commandButton value="Save" action="{!save}"/>
                <apex:commandButton value="Cancel" action="{!cancel}"/>
        </apex:pageBlockButtons>
    <apex:pageBlockSection title="Information" >
                <apex:outputfield value="{! Opportunity.name}"/>
                <apex:outputfield value="{! Opportunity.Type}"/>
                <apex:outputfield value="{! Opportunity.Amount}"/>
   </apex:pageBlockSection>
   <apex:pageBlockSection title="Contacts">
                 <apex:inputField value="{! Opportunity.Bill_to__c}" label="Bill TO"/>
   </apex:pageBlockSection>
</apex:pageblock>
            </apex:form>

</apex:page>


I tried to add the <script> but I am not able to achive it.
  • August 06, 2022
  • Like
  • 0

Hi all,
User-added imageIm trying to open convert lead page in lightning, based on conditions.

even i open this page in lighting using standard URL and passing ID it is opening in classic

('/lead/leadconvert.jsp?retURL=%2F{!Lead.Id}&id={!Lead.Id}')

is there any way to show this in lightning view by checking conditions.

Thank you.
Hi there,

I develop a custom component to call standard lead convert action.
I found this component runtime_sales_lead__convertDesktopConsole.
It works well. But Cancel action does not work. (See screenshot).

I call this component with parameters.

urlEvent.setParams({
"url": baseURL + '/lightning/cmp/runtime_sales_lead__convertDesktopConsole?leadConvert__leadId=' + recordId+ '&ws=%2Flightning%2Fr%2FLead%2F'+recordId+'%2Fview'
});

Maybe I should add a return URL for your component?
Can you send me a specification for this component with all parameters to solve this issue?User-added image