This post is a part of the daily blog series 

A Tip A Day, daily dosage of learning!


 Day #1 – Lead Conversion Mapping To Standard Fields

Today, I was working on lead fields mapping for lead conversion – standard feature, simple right?  The standard feature that lets you map Lead fields to Account, Contact and Opportunity objects.  (Can be accessed from Setup–> Lead–> Fields –>Map Lead Fields) So, when a lead converts, the field values are copied from Lead to the chosen object’s fields based on the mapping.

Learning: What I’ve learnt is that I “Cannot map lead fields to standard Account fields” – that’s a bummer!  So, I couldn’t map Lead’s Account Type field to Account’s Type standard field.

Screen Shot 2017-07-19 at 5.44.25 PM

Solution – The workaround I tried was to create a custom field in Account – named Customer Type and map that field to the Lead Type field in the Lead mapping.

Great, but that doesn’t complete the job as the existing accounts do not have any value in this new field.  So, I just wrote this simple code to copy all of the ‘Type’ field values to ‘Customer Type’ in all accounts and also replaced the Type field in the Account page layouts with Customer Type.  So, going forward we will just use Customer Type instead of the Type field.  You should run this code one time in Developer Console –> Debug –> Execute Anonymous Window

 

 


Read all other tips of the blog series here – A Tip A Day, daily dosage of learning!

Advertisements