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
krishna3krishna3 

Custom lead Conversion page

I am trying to convert the lead to Account, Contact and Opportunity and there are standard and custom fields required in the convert page.

here i want to use the same standard page and fuctionality and add the additional fields to that page.

 

if it possilble??

if it possible suggest me some code for that.

 

 

thanks,

 

b-Forceb-Force

If you want to display this fields on that ConvertLead.jsp page , then It is not possible to add some more fields on that page by standard customization.

 

To achieve this you need to go for VF page and Hit ConvertLead Standard API call from Controller,

create custom button ContentSource as javascript and redirect to that page [or custom button with contentSource as VF page ] use this Custom button to LeadConversion

 

If you are interested in only Validation of these fields, use CustomButton with content source as Javascript

do your validation and then redirect to COnvertLead.jsp page and pass Lead Id as parameter

like

 

/lead/leadconvert.jsp?id={LeadId}

 

 

Hope this will help you

 

Thanks,

Bala

krishna3krishna3

Thanks for giving me reply..

 

so i have to create a visualforce page for lead convesion and add additional fields on it.

 

i tried this way but i could not able to get the lookup field for account and also the convert button is not working when i ovveride the standard with visualforce page.

 

here is the visualforce page and class that i written....can anyone help me on this.

 

thanks,

 

visualforce page:

 

 

<apex:page standardController="lead" tabStyle="Lead" extensions="leadConvertController" >
<apex:messages />
<apex:sectionHeader title="Convert Lead"/>
<apex:form >
<apex:pageBlock mode="Edit">
<apex:pagemessages />
<apex:pageBlockSection title="Convert Lead" columns="1">
         <apex:pageBlockSectionItem >
            <apex:outputLabel value=" Record Owner" for="Record Owner"/>
            <apex:inputField value="{!Lead.OwnerID}"/>
          </apex:pageBlockSectionItem>
        <apex:pageBlockSectionItem >
           <apex:OutputLabel for="Send Email to the Owner">Send Email to the Owner:</apex:OutputLabel>
           <apex:inputCheckbox onclick="{!Lead.Ownerid}"/>
           </apex:pageBlockSectionItem> 
            <apex:pageBlockSectionItem >
            <apex:outputLabel for="Last Name">Last Name</apex:outputLabel>
             <apex:inputField id="Name" value="{!Lead.LastName}" />
          </apex:pageBlockSectionItem>      
        <apex:pageBlockSectionItem >
            <apex:outputLabel for="Account Name">Account Name</apex:outputLabel>
             <apex:inputField required="true" id="Owner" value="{!Lead.Company}" />
          </apex:pageBlockSectionItem>
        <apex:pageBlockSectionItem >
            <apex:outputLabel for="Oppt Name">Opportunity Name:</apex:outputLabel>
             <apex:inputField required="true" id="Owner" value="{!Lead.Company}" />
          </apex:pageBlockSectionItem>
          <apex:pageblockSectionItem >
          <apex:outputLabel for="no oppty">Do not create new opportunity upon conversion</apex:outputLabel>
          <apex:inputCheckbox required="true" onselect="{!lead.Company}"/>
          </apex:pageblockSectionItem>
          <apex:pageBlockSectionItem >
                      <apex:outputLabel for="ConStatus">Converted Status:</apex:outputLabel>
             <apex:inputField id="ConStatus" value="{!Lead.Status}" />
          </apex:pageBlockSectionItem>
          </apex:pageBlockSection>         
<apex:pageBlockSection title="Address Information" columns="1" id="AddressInformation">
          <apex:pageBlockSectionItem >
            <apex:outputLabel for="StreetAdd">Street Address:</apex:outputLabel>
          <apex:inputField required="true" Id="StreetAdd" Value="{!Lead.Street}" />
          </apex:pageBlockSectionItem>
        <apex:pageBlockSectionItem >
            <apex:outputLabel for="City">City:</apex:outputLabel>
          <apex:inputField required="true" Id="City" Value="{!Lead.City}" />
          </apex:pageBlockSectionItem>
        <apex:pageBlockSectionItem >
            <apex:outputLabel for="State">State:</apex:outputLabel>
            <apex:inputField required="true" Id="State" Value="{!Lead.State}" />
          </apex:pageBlockSectionItem>
        <apex:pageBlockSectionItem >
            <apex:outputLabel for="Zip">Postal Code:</apex:outputLabel>
            <apex:inputField required="true" Id="Zip" Value="{!Lead.PostalCode}" />
          </apex:pageBlockSectionItem>                    
          </apex:pageBlockSection>
 <apex:pageBlockSection title="Additional Information" columns="2" id="AdditionalInformation">
          <apex:pageBlockSectionItem >
            <apex:outputLabel for="NoofEmp">No. Of Employees:</apex:outputLabel>
            <apex:inputField Id="Owner" Value="{!Lead.NumberOfEmployees}" />
          </apex:pageBlockSectionItem>
        <apex:pageBlockSectionItem >
            <apex:outputLabel for="Revenue">Annual Revenue:</apex:outputLabel>
                <apex:inputField Id="Revenue" Value="{!Lead.AnnualRevenue}" />      
                      </apex:pageBlockSectionItem>
        <apex:pageBlockSectionItem >
            <apex:outputLabel for="Industry">Industry:</apex:outputLabel>
           <apex:inputField Id="Industry" Value="{!Lead.Industry}" />
          </apex:pageBlockSectionItem>
        <apex:pageBlockSectionItem >
            <apex:outputLabel for="Description">Description:</apex:outputLabel>
            <apex:inputField Id="Description" Value="{!Lead.Description}" />
          </apex:pageBlockSectionItem>
        <apex:pageblockSectionItem >
          <apex:outputLabel for="Phone">Phone</apex:outputLabel>
          <apex:inputField required="true" id="Phone" value="{!Lead.Phone}"/>
          </apex:pageblockSectionItem>
        <apex:pageBlockSectionItem >
        <apex:outputLabel for="Email">Email</apex:outputLabel>
        <apex:inputField required="true" id="Email" value="{!Lead.Email}"/>
        </apex:pageBlockSectionItem>  
        <apex:pageBlockSectionItem >
            <apex:outputLabel for="Website">Website:</apex:outputLabel>
          <apex:inputField Id="Website" Value="{!Lead.Website}" />
          </apex:pageBlockSectionItem>  
          </apex:pageBlockSection>                                   
<apex:pageBlockSection title="Task Information" columns="2" id="TaskInformation">
         <apex:pageBlockSectionItem >
            <apex:outputLabel for="Status">Status</apex:outputLabel>
            <apex:inputField value="{!Task.Status}"/>
          </apex:pageBlockSectionItem>
        <apex:pageBlockSectionItem >
            <apex:outputLabel for="DueDate">Due Date</apex:outputLabel>
            <apex:inputField value="{!Task.ActivityDate}"/>
        </apex:pageBlockSectionItem>
        <apex:pageBlockSectionItem >
            <apex:outputLabel for="Priority">Priority</apex:outputLabel>
            <apex:inputField value="{!Task.Priority}"/>
          </apex:pageBlockSectionItem>
       </apex:pageBlockSection>      
<apex:pageBlockSection title="Description Information" columns="1" id="DescriptionInformation">
         <apex:pageBlockSectionItem >
            <apex:outputLabel for="Subject">Subject</apex:outputLabel>
            <apex:inputField required="true" value="{!Task.Subject}"/>
          </apex:pageBlockSectionItem>
        <apex:pageBlockSectionItem >
            <apex:outputLabel for="Comments">Comments</apex:outputLabel>
            <apex:inputField value="{!Task.Description}"/>
          </apex:pageBlockSectionItem>
         <apex:pageBlockSectionItem >
          <apex:OutputLabel for="Send Notification Email">Send Notification Email</apex:OutputLabel>
           <apex:inputCheckbox onclick=""/>
           </apex:pageBlockSectionItem>
          </apex:pageBlockSection> 
 <apex:pageBlockSection title="Reminder" columns="1" id="Reminder">
   <apex:pageBlockSectionItem >
     <apex:outputLabel for="Reminder">Reminder</apex:outputLabel>
     <apex:inputField id="Reminder" value="{!task.ReminderDateTime}"/>
          </apex:pageBlockSectionItem>
  </apex:pageBlockSection>           
<apex:pageBlockButtons >  
        <apex:commandButton value="Convert"/>
        <apex:commandButton Action="{!Cancel}" value="Cancel"/>
         </apex:pageBlockButtons>                                     
          </apex:pageBlock>  
</apex:form>               
</apex:page>
Class:

 

public class leadController {

        
public leadController(ApexPages.StandardController controller) {

}

public Task getTask(){
    Task tsk = new Task();
    return tsk;
}
    

}