Tuesday, August 23, 2011

Loading Converted Leads

      When you are migrating data from one system to another there will be a need to load the leads as converted as they would have been already converted in the source system.

    First step is to raise the case with salesforce.com to open up the audit fields for your organisation. The fields CONVERTEDACCOUNTID, CONVERTEDCONTACTID, CONVERTEDOPPORTUNITYID and CONVERTEDDATE will not be visible while inserting or updating by default.

Once the salesforce allows you to load these system fields you can start your process.

Steps for Loading
  • Firstly, Load Account, Contact and Opportunity which needs to be associated with the converted lead.
  • Next prepare a csv files with information of lead and get the ids from previous step and load it into the appropriate converted fields of file as mentioned above.
  • The field Isconverted should be set to true
  • Insert, Update or Upsert the leads as necessary.
    Things to consider while loading

    • Converted Account is mandatory . Converted contact and opportunity is not mandatory. converted contact and opportunity need not belong to converted account.
    • You cannot see the information of converted leads. If you go to the lead detail page through its id you will see information on Converted date, Converted account, Contact and opportunity whichever was mapped. Only way to extract the information is through API
    • Lead conversion mapping will not be respected.For eg Lead description is mapped to contact description and when u load the converted lead with description it will not be carried over to the converted contact.
    • Converted date if not mapped will give value This lead was converted on {0} on lead detail page. If you need to enter converted date make sure you also enter created date . Otherwise it would error out as created date would be defaulted to now which will be at future date when compared to converted date.
    • Lead triggers and validation rules will be fired.
    • Converted Leads cannot be updated but can be deleted 
    click here to have a look at the sample csv file.
      If you have any questions please post it in comments section