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
Chandra Kant BaghelChandra Kant Baghel 

How to get lead mapping in apex?

Hi All,

I want to fetch the lead mapping in apex i.e. which lead fields are mapped to which fields of Account / Contact / Opportunity.

Any pointers that can be used to approach this?

Thanks
Maharajan CMaharajan C
Hi Chandra,

I think still there is no way to fetch the lead mapping in apex.

Same Queriy already discussed here:
https://trailblazer.salesforce.com/ideaView?id=0873A000000TvkCQAS
https://salesforce.stackexchange.com/questions/19050/access-lead-conversion-field-mappings-from-apex

Thanks,
Maharajan.C
Suraj Tripathi 47Suraj Tripathi 47

Try these below steps

 

1. Click the gear icon in the upper right and click Setup
2. Click the Object Manager tab
3. Click on the object you want your Lead field to map to (Account, Contact, or Opportunity)
4. Click Fields & Relationships in the left navigation
5. Click New

Choose the same Data Type as it exists on the Lead object (for example, if Lead has a custom field called 'Region' and this is a picklist, be sure to choose the Data Type of picklist with the same picklist options as it exists on the lead object).

6. Click Next
7. Give the field a label and set any other options to match your Lead field
8. Click Next
9. Click Next
10. Click Save
11. Repeat this process for any other objects you want the Lead field to map to
12. Click the Object Manager tab
13. Click Lead
14. Click Fields & Relationships in the left navigation
15. Click Map Lead Fields

From here you can click on each object (Account, Contact, Opportunity) and map the custom Lead field to the newly created custom fields. Click Save once everything is mapped.

Note: 
It is not possible to map a custom Lead field to a standard Salesforce field.
If you set a custom field to Required on the Account, Contact, or Opportunity object and do not create mapping from a Lead field the conversion will error.

Thank You