Copying Fields Automatically in Lead Conversion
Overview
The Leads module is often used to track less-developed relationships with individuals, often in conjunction with a qualification process that results in leads being converted to accounts, contacts, opportunities, etc. While Sugar automatically carries over most stock lead fields, you need to take additional steps for conversion to carry over any custom fields you have added to the leads module. This article covers how to make additional fields copy over to related modules (e.g., Accounts, Contacts, and Opportunities) during lead conversion.
Beginning with version 9.1.0, each user's license type (e.g., Sugar Serve) determines what functionality is available as described in the License Types Matrix documentation. Please note that the Leads module is not available for Sugar Serve users.
Prerequisites
You must be an administrator or have developer-level role access to create custom fields as required by this article. For more information on creating fields, please refer to the Studio documentation.
Steps to Complete
For a field to carry over its value to another record on lead conversion, two conditions must be met:
- The field must exist in both the Leads module and the destination module (e.g., Contacts) with identical database names as explained in the Creating Matching Fields section below.
- In Studio, the Convert Lead layout must be configured to copy data to the destination module as explained in the Enabling the "Copy Data" Function section of this article.
Creating Matching Fields
For the first requirement, you will need to have two matching fields: one in the Leads module and one in the module where the field's value should transfer (e.g., Contacts, Accounts, and Opportunities). The way you configure these fields will depend on whether you want to copy the value of a stock leads field (e.g., First Name, Title) or a custom leads field that you added (e.g., Nickname). We explain both approaches in the next two sections. Please refer to the appropriate section that applies to your use case.
Copying a Custom Field to a Custom Field
As an example, we will add a Nickname field to the Leads module that will copy to a custom Nickname field on the new contact record when the lead is converted. Use the following steps to create a new text field in Studio for the Leads module and then repeat the same steps for the Contacts module:
- Navigate to Admin > Studio > Leads > Fields then click the Add Field button.
- Select the Data Type "TextField" then set the Field Name to "nickname". Save the new field after completing any remaining optional attributes.
Note: After saving a new field, Sugar will automatically append the characters "_c" to the end of the field name to indicate that it is a custom field. The field's database name will, therefore, benickname_c
, as you can see in the Fields table after clicking "Save". - Next, navigate to Admin > Studio > Leads > Layouts, and add the Nickname field to the Leads record view layout and any other layouts you would like. For more information on editing layouts in Studio, please refer to the Studio documentation.
- Repeat steps 1 - 3 in the module to which you want the field to copy during lead conversion. For this example, navigate to Admin > Studio > Contacts > Fields to create a text field with Field Name also set to "nickname".
You have now satisfied the first condition for copying a lead's custom field value to another module's custom field on lead conversion. Please proceed to the Enabling the "Copy Data" Function section of this article to complete the setup.
Copying a Stock Field to a Custom Field
Since Sugar distinguishes custom fields by adding a "_c" suffix to their database names, there is an additional layer of complexity when you wish to copy the value of a stock field to another module's custom field during lead conversion. Custom fields always end with "_c" and stock fields never do, making it impossible for them to have identical database names. We can work around this by adding a calculated custom field to the Leads module that mimics the stock field's value and mapping it to the custom field in the destination module.
As an example, we will add a field to the contact record which contains date that the converted lead record was created. In other words, we will copy the stock Date Created field from the Leads module to a custom datetime field in the Contacts module.
- Navigate to Admin > Studio > Leads > Fields then click the Add Field button.
- Select the Data Type "Datetime" then set the Field Name to "lead_created".
- Mark the Calculated Value checkbox then click the Edit Formula button.
- Type the search term "enter" into the "Search Fields..." box then click on the
$date_entered
field to add it to the Formula Builder window. Click "Save" to return to the new field's settings. - Save the new field after completing any remaining optional attributes. We will not add this field to the Leads layouts.
Note: After saving a new field, Sugar will automatically append the characters "_c" to the end of the field name to indicate that it is a custom field. The field's database name will, therefore, belead_created_c
, as you can see in the Fields table after clicking "Save". - Next, create the matching field in the Contacts module. Navigate to Admin > Studio > Contacts > Fields then click the Add Field button.
- Select the Data Type "Datetime" then set the Field Name to "lead_created". This time, do not place a checkmark next to "Calculated Value" like we did for the Leads field. Simply save the new field after completing any remaining optional attributes.
Note: After saving a new field, Sugar will automatically append the characters "_c" to the end of the field name to indicate that it is a custom field. The field's database name will be the same as the field (lead_created_c
) we created in the Leads module. - Finally, navigate to Admin > Studio > Contacts > Layouts, and add the Lead Created field to the Contacts record view layout and any other layouts you would like. For more information on editing layouts in Studio, please refer to the Studio documentation.
Note: Calculated values are not automatically populated for existing Sugar records. This means that the existing lead records will initially have a blank Lead Created field, and the matching field on the contact record will also be blank after conversion. For information on how to populate the calculated field values for existing leads, please refer to the Introduction to Calculated Fields article.
You have now satisfied the first condition for copying the value of a lead's stock field to another module's custom field during lead conversion. Please proceed to the Enabling the "Copy Data" Function section below to complete the setup.
Enabling the "Copy Data" Function
The second requirement for a field to carry over its value during lead conversion involves a configuration of the Convert Lead layout in Studio. Use the following steps to confirm that the lead conversion settings in Studio are set to copy data from leads to the destination module:
- Navigate to Studio > Leads > Layouts > Convert Lead.
- Confirm that the checkbox is selected under "Copy Data" for the destination module(s) you are copying a field to. For the examples presented above, we are copying to the Contacts module, which is always selected by default. If your use case requires a different destination module, please select the Copy Data box next to that module's name. If the module you require is not listed in the Convert Lead module list, please refer to the Adding Custom Modules to Lead Conversion article for steps on adding the necessary module(s).
- Click "Save" to preserve any changes to the lead conversion settings.
Application
Now that the field and conversion settings are ready, create and then convert a new lead to test the behavior. Be sure to populate the field that will be copied on conversion.
For the custom field to custom field use case, the Nickname field is copied from the lead to the contact during conversion:
For the stock field to custom field use case, the lead's creation date is copied to the contact during conversion: