How to create a multiple contacts if the last name of lead object field contain two or more names in salesforce for eg if i put last name as a "Bosnon, Bonny mankotia" in a last name field of lead object.Its create new contact of Bonny mankotia after lead conversion?


You cannot really alter the standard lead conversion process. But if this is critical , you have couple of ways to do it. I am highlighting only one -

  • Implement an after update trigger on Lead.
  • In the trigger, check for the value isConverted=true.
  • if yes, then fetch the ConvertedContactId field from lead.
  • Using this field, Query on contact object and fetch the contact LastName.
  • Split the last Name by Comma.
  • The list of string will give you give you elements corresponding to number of names.
  • Edit the existing contact to reflect the correct name by removing text post commas.
  • Create new instance of Contact(s) for other elements in the list of string and insert new contacts

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.