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
dietcoladietcola 

automatically create custom object record upon lead conversion

Hi, All-

 

I originally posted this in another forum, but a savvy user pointed me this direction.

 

I would like to have Salesforce automatically create a record in one of my custom objects every time a Lead is converted to a Person Account.  I'll eventually need these records to auto-fill some information from related records in another object as well, but I'm happy to start with just automating record creation.

 

I'm decent at customizing Salesforce for what we want it to do with Workflows, Field Updates, etc., but I have zero experience with Apex Code.

 

If someone could even tell me the part of Salesforce Setup to go to in order to access where I would put this code, that would helpful!  Many thanks in advance.

jkucerajkucera

You can't write code directly in production orgs - you can in Sandbox or developer orgs.  Write them in another org first, then deploy to production.  You want a Lead trigger here:

 

Setup--> Customize-->Leads-->Triggers-->New

 

Note you'll have to write a test before you can deploy it as well.

dietcoladietcola

That's very good to know--I'm working in the Sandbox now anyway, so that's good news.

 

I'll research some online Apex code resources, but if anyone knows of some good ones off the top of your head, please send them my way.

 

Thank you for your help!