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
sean_homelesssean_homeless 

Creating a new Child Record using Workflows

We use web-to-lead to add customers from our website.

 

I have created a custom object that is a child (Orders) to our contacts object. This custom object stores all the order information for the customer based on the information they entered on the website (that was sent to the leads object through web-to-lead)

 

I would like to create a workflow that fires when the convert lead button is clicked. I need a new child (Orders) record to be created and the information from the lead object to be entered into that record. The workflow should link this newly created Order record to the associated Contact record that was created in the convert lead operation.

 

I have looked through the help files and seen that Workflows are used for the following:

 

Email alerts

Tasks

Field Updates

Outbound Messages

 

Is there any way that they can be used to create new records for a child object of Contacts when a lead is converted?

 

Any help would be most appreaciated!

 

Sean

shillyershillyer

Hi Sean,

 

You can do this with Apex. Take a look at this example in the Force.com cookbook. It explains how to create a child record when the parent is created.

 

Hope that helps,

Sati

sean_homelesssean_homeless

Hi sati

 

I will check that out. Now the question is to find out how to use that code :)

Will let you know if it works

 

Thanks

 

Sean