Loading

How to get the Lead Id from its converted Account

Data pubblicazione: Apr 2, 2026
Descrizione

When a Lead is converted into an Account, Contact and Opportunity you may want to track this against the converted records. In this article we will work through the steps to indicate that an Account was created from a Lead and which Lead it was created from

 

Risoluzione

This article will guide you through the creation of a Created from Lead? checkbox field and another field to store the Lead Id. Depending on your exact requirements or business process you may not need both of these fields and you could also extend this approach to the Opportunity and Contact objects too.

 

Be sure to develop these changes in a Sandbox first and thoroughly test before deploying to Production. During development it will help to show the fields on the page for testing purposes, but afterwards you may want to hide these from users.

 

For the purposes of this article we will assume you have the Customize Application Permission, which will grant you the necessary access to perform these steps. To get started we need to create some Custom Fields on the Lead object. Navigate to Setup by pressing on the Settings Cog and then Setup in the top right hand corner.

 

Part 1: Create Custom Fields on the Lead Object 

Create the "Created from Lead?" Checkbox Field

 

Pic1.png 

 

Step 1: From Setup press on Object Manager

 

Pic2.png 

 

  • From Object Manager use the Quick Find to Search Lead object.
  • Open lead object

 

    Pic3.png

     

    Step 2: Press on Fields & Relationships from the left hand side menu

     

    Pic4.png

     

    Step 3: Press on New from the action panel towards the top of the page

     

    Pic5.png

     

    Step 4: Select Checkbox from the list of Data Type and then press Next

     

    Pic6.png

     

    Step 5: Set the Field Label, Default Value to Checked and then provide a Description and Help Text

     

    Pic7.png

     

    Step 6: Set the field as Visible and/or Read Only and then press Next. If you have Field-Level Security for Permission Sets during Field Creation enabled you will be able to do this on a Permission Set Level, otherwise you will be able to do this per Profile

     

    Pic11.png

     

     

    Pic12.png

     

     

    Step 7: Add the field to Dynamic Forms-enabled record pages. You will only see this screen if you have Lightning Pages for the Lead Object that use Dynamic Forms

     

    Pic13.png

     

    Step 8: Add the field to the relevant Page Layouts and then press Save & New

     

     

    Pic14.png

    Create the "Lead Id" Formula Field

    Step 9: Select Formula from the list of Data Type and then press Next

     

    Pic15.png

     

    Step 10: Set the Field Label and the Formula Return Type as Text and then press Next

     

    Pic16.png

     

         

     

     Step 11: Set the Formula as CASESAFEID(id) add a Description, Help Text and then press Next

     

    Pic17.png

     

     

    Pic18.png

     

    • Set the Field as Visible and/or Read Only and then press Next. If you have Field-Level Security for Permission Sets during Field Creation enabled you will be able to do this on a Permission Set Level, otherwise you will be able to do this per Profile

     

    Pic19.png

     

    Pic20.png

     

    Step 12: Add the Field to Dynamic Forms-enabled record pages. You will only see this screen if you have Lightning Pages for the Lead Object that use Dynamic Forms

     

    Pic21.png

     

    Step 13: Add the field to the relevant Page Layouts and then press Save

     

    Pic22.png

    • Now that we’ve created our custom Lead fields let’s create Account fields to map them to. Press on Object Manager and then on Accounts

     

    pic23.png

     


    Create Custom Fields on the Account Object

    Step 14: Click on Fields & Relationships and then New

     

    Pic24.png

     

    Step 15: Select Checkbox from the list of Data Type and then press Next

     

    Pic26.png

     

    Step 16: Set the Field Label and then provide a Description and Help Text. Leave the Default value as Unchecked and then press Next

     

    Pic27.png

     

     

    Step 17: Set the Field as Visible and/or Read Only and then press Next. If you have Field-Level Security for Permission Sets during Field Creation enabled you will be able to do this on a Permission Set Level, otherwise you will be able to do this per Profile

     

     

    Pic28.png

       Pic29.png 

     

     Step 18: Add the Field to Dynamic Forms enabled Lightning Pages. You will only see this screen if you have Lightning Pages for the Account object that use Dynamic Forms

     

     

    Pic30.png

     

    Step 19: Add the field to the relevant Page Layouts and then press Save & New

     

    Pic31.png

     

    Step 20: Select Text from the list of Data Types and then press Next

     

    Pic32.png

     

    Step 21: Set the Field Label, Length to 255 and then provide a Description and Help Text

     

    Pic33.png

     

    Step 22: Set the field as Visible and/or Read Only and then press Next. If you have Field-Level Security for Permission Sets during Field Creation enabled you will be able to do this on a Permission Set Level, otherwise you will be able to do this per Profile

     

    Pic34.png

     

    Pic35.png

     

     

    Step 23: Add the field to Dynamic Forms-enabled record pages. You will only see this screen if you have Lightning Pages for the Account  Object that use Dynamic Forms

     

     

    Pic36.png

     

    Step 24: Add the field to the relevant Page Layouts and then press Save

     

    Pic37.png

    Map Lead Fields on Conversion

     

    Step 25: Now that we’ve created our Lead fields and target fields on the Account Object, we need to map the values over on Lead conversion. this let’s head back to Object Manager

     

    Pic38.png

     

    • Use the Quick Find to Search for Lead and then press on Lead

     

    Pic39.png

     

    • Press on Fields & Relationships

     

    Pic40.png

     

     

    • Press on Map Lead Fields

     

    Pic41.png

     

    Step 26: Make sure that the Account Tab is selected and map Created from Lead? and Lead Id to the Account Fields and then press Save

    Pic42.png


    Test Your Configuration

    Step 27: Using the App Launcher navigate to the Leads Tab to test your changes

     

    Pic43.png

     

    Step 28: From the Leads Tab press on New and create a new record, on the new page you should observe your new fields with their Default Values. Once you’ve populated the required fields press Save

     

    Pic44.png

     

    Step 29: From the Lead press on Convert and select the options for new Account, Contact and Opportunity and then press Convert

     

     

    Pic45.png

     

    Pic46.png

     

    Step 30: Once the Lead has been converted click through to the Account record

     

    Pic47.png

     

    Step 31: From the Account Page make sure that Created from Lead? is TRUE and the Lead Id is populated too

     

    Pic48.png

     

    • It’s worth noting that this process will not automatically update existing records. Any unconverted Leads created before this process will need to have Created from Lead? set to TRUE via a tool such as Data Loader
    • Additionally, you can export converted Leads so that you could update the converted Accounts so that Created from Lead? is TRUE and Lead Id is populated too

     

    Risorse aggiuntive

    If you prefer this in a Video How-To format then you can watch this as a demo on YouTube: https://youtu.be/onkXQdCWzfI

    https://help.salesforce.com/s/articleView?id=000386451&type=1

    Numero articolo Knowledge

    001738818

     
    Caricamento
    Salesforce Help | Article