# Set up Lead or Contact Creation for Salesforce CRM

Once Cloud Voice is connected to Salesforce CRM (Customer Relationship Management, the system that stores your contact and sales records), you can have calls involving unrecognized numbers turned into CRM records. A lead or contact can be generated whenever an extension user answers a call from a number that isn't in the CRM, or dials out to one. Turning this on keeps your CRM populated without manual data entry and makes sure caller details aren't lost.

## Before you start

Make sure the [Salesforce CRM integration](/pbx/integrations/salesforce/integrate-cloud-voice-cloud-voice-with-salesforce-crm/#integrate-yeastar-p-series-pbx-with-salesforce-crm) is already set up.

## Configure record creation

1. Sign in to the Cloud Voice management portal and open **Integrations > CRM**.
2. On the CRM integration page, enable **Create New Contact**.
3. Open the **Create Contact or Lead** drop-down list and choose which record type Cloud Voice should generate.

   ![Drop-down list for choosing whether an unknown number becomes a contact or a lead](/images/pbx/creat-lead-or-contact.png)

   - **Contacts**: store the unknown number as a Contact.
   - **Leads**: store the unknown number as a Lead.
4. Under **Create Method**, decide how records get added.

   - To let Cloud Voice add records on its own for the call directions you specify:
   1. Choose **Automatically**.
   2. Use the **Call Type** drop-down list to pick which calls trigger creation.

        ![Call type options that determine when a record is created automatically](/images/pbx/select-in-or-out-to-create-new-contact.png)

        - **Inbound**: an incoming call from an unknown number that matches no existing Contact, Lead, or Account in the CRM.
        - **Outbound**: an outgoing call to an unknown number that matches no existing Contact, Lead, or Account in the CRM.

        :::caution
        With **Inbound** selected, a record is created for every unknown number that calls in, including spam and robocalls. This can clutter the CRM with unwanted entries. If that is a concern, limit automatic creation to **Outbound** or use **Manually** instead.
        :::
   - To let the assigned extension users add records themselves while on a call, choose **Manually**. This gives users control over which numbers become records, which keeps the CRM cleaner.
5. Click **Save**.

## What happens next

- With automatic creation set up, a new lead or contact appears in Salesforce CRM whenever a call goes to, or comes from, an unknown number.

  :::note
  Automatically generated records are named with the prefix `Automatic New Contact` followed by the number.
  :::

  ![A record added to Salesforce CRM with the automatic naming prefix](/images/pbx/new-contact-created-on-crm.png)

- With manual creation set up, the assigned extension users can add an unknown number to the CRM as a lead or contact during the call.

  ![Adding an unknown caller to the CRM by hand during a call](/images/pbx/manually-create-crm-contact.png)

:::note
When [Contact Synchronization](/pbx/integrations/salesforce/set-up-contact-synchronization-with-salesforce-crm/) is turned on, any lead or contact created this way is also copied into the Cloud Voice phonebook automatically.
:::
