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
Will EdwardsWill Edwards 

How do I have a two-stage lead creation process?

I would like to use, Visualforce, and Apex to create a two-stage lead creation process. I'd like for person A to access a Visualforce page on a site.

Here's the Visualforce code for the first nomination form.
<apex:page standardController="Lead"
           title="Submit Nominee for Digital Accelerator" showHeader="false"
 <apex:composition template="{!$Site.Template}">
  <apex:define name="body">
   <apex:form >
    <apex:messages id="error"
      <apex:pageBlock title="" mode="edit">
        <apex:pageBlockButtons >
           <apex:commandButton value="Submit"
        <apex:pageBlockSection title="Contact Us"
        <div class = "requiredInput">
        <div class = "requiredBlock"></div>
         <apex:inputField value="{!Lead.FirstName}" required="true"/>
         <apex:inputField value="{!Lead.LastName}" required="true"/>
         <apex:inputField value="{!Lead.Title}" required="true"/>
         <apex:inputField value="{!Lead.Email}" required="true"/>
         <apex:inputField value="{!Lead.Company}" required="true"/>
        <input type="hidden" name="Campaign_ID" value="{$CurrentPage.parameters.MeetingValue}" />
And the Apex controller:
public class myWeb2LeadExtension {

    private final Lead weblead;

    public myWeb2LeadExtension(ApexPages.StandardController
                                stdController) {
       weblead = (Lead)stdController.getRecord();

     public PageReference saveLead() {
       try {
       catch(System.DMLException e) {
           return null;
       PageReference p = Page.ThankYou;
       return p;
This will create a lead with some of the information. I'd then like to send a link to the nominee with most of the information filled in and request they add some follow up information. I was thinking of having a hidden value of the lead ID passed through the URL and then writing an Apex controller to update that specific lead.

Any recommendations?

Hi Edward,

This can be acheieved using sites as you have mentioned. The only limitation that we have in sites is that, Lead can be viewed and created but not edited or deleted from the sites.

As per my understanding the sales team will partially fill the lead details and send the url to lead itself. So leads will open the URL and they will create update the remaining fields in leads and save the record.

If my above understanding is correct. Below is the option that we can make use of.
1. We need a custom object to store the First half of the lead information.
2, The sales team will create a record in that custom object and we can use a workflow rule to send email to the email id present in that record with the ID of the record.
3. In sites we can use the VF Page to display the values from the Custom Object and will also display the remaining lead fields that they are forced to fill. Later we can save all the information in the lead.and at the same time we can delete the custom object record. after inserting the lead record.

Let me know if you have any question in this model.

Manoj S
Will EdwardsWill Edwards
Manoj, I've gone a different direction. Thanks, though.