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
XVLXVL 

Trigger to Convert Lead to Contact with Custom Object

I need to wrtie a trigger to  convert a lead to a contact with a custom object attached to the contact if the lead has field values. For example, if a person signs up for a trial, I need the trial information move to the custom object Trial Information. The fields in the lead section would map to the custom fileds in the custom object. The custom object should only be created if there is a value there. 

Lead Fields: 
First Name- John
Last Name- Smith
Company- ABC Corp
Trial Name- XYZ Mag
Start Date- 4/12/2014
End Date-4/19/2014

Convert Lead to Contact:
Object: Contact
First Name- John
Last Name- Smith
Object/Field: Account (Company)-ABC Corp
Custom Object: Trial Information
Trial Name- XYZ Mag
Start Date- 4/12/2014
End Date-4/19/2014


Best Answer chosen by XVL
Ashish_SFDCAshish_SFDC
Hi , 


See the below links, 

Idea,

https://success.salesforce.com/ideaview?id=08730000000BrltAAC

An App,

https://appexchange.salesforce.com/listingDetail?listingId=a0N30000003JeOiEAK

Related thread, 

https://developer.salesforce.com/forums?id=906F00000008krAIAQ

http://salesforce.stackexchange.com/questions/22846/lead-conversion-to-custom-object


Regards,
Ashish