# Salesforce Cloud

[<mark style="color:blue;">Salesforce Cloud</mark>](https://www.salesforce.com) is a customer relationship management (CRM) platform for customer service and support teams, enabling users to automate service processes, streamline workflows and find key articles.

Route detailed ticket alerts from Salesforce Cloud to the right users in Squadcast.

## How to integrate Salesforce Cloud with Squadcast

### In Squadcast: Using Salesforce Cloud as an Alert Source

1. Navigate to **Services** -> **Service Overview** -> select or search for your Service. Expand the accordion -> In the Alert Sources section, click **Add**.

<figure><img src="https://github.com/solarwinds-cloud/sq-Gitbook/blob/main/.gitbook/assets/21spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-4fbd74e7ca0b30173c47a1d58ed6a0804a0465aa%2FAlert_Sources%20(1).png" alt="Add salesforce cloud as an alert source - Squadcast" width="563"><figcaption></figcaption></figure>

2\. Select **Salesforce Cloud.** Copy the displayed **Webhook URL** to [configure](#in-salesforce-cloud-create-a-squadcast-webhook) it within **Salesforce Cloud**. Finish by clicking **Add Alert Source** -> **Done.**

<figure><img src="https://github.com/solarwinds-cloud/sq-Gitbook/blob/main/.gitbook/assets/21spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-d792521ee1393e269b3975ef40409108d67ffe2c%2FSalesforceCloud.png" alt="Configure the salesforce cloud using webhook URL" width="563"><figcaption></figcaption></figure>

{% hint style="warning" %} <mark style="color:orange;">**Important**</mark>**:**

When an alert source turns <mark style="color:green;">Active</mark>, it’ll show up under Configured Alert Sources, you can either generate a test alert from the integration or wait for a real-time alert to be generated by the Alert Source.

An Alert Source is <mark style="color:green;">active</mark> if there is a recorded incident via that Alert Source for the Service.
{% endhint %}

### In Salesforce Cloud: Create a Squadcast Webhook

1. Download the [squadcastClass.apxc](https://github.com/SquadcastHub/squadcast-salesforce-cloud-integration/blob/master/squadcastClass.apxt) file
2. In Salesforce Service Cloud, click on the **Settings** icon and then, click on the **Developer Console**

<figure><img src="https://github.com/solarwinds-cloud/sq-Gitbook/blob/main/.gitbook/assets/21spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-06940d0567607ed3689fa4f77d0565f6eae0686d%2Fsalesforce_2.png" alt="Create Squadcast webhook using developer console" width="296"><figcaption></figcaption></figure>

3. In the **Developer Console** page, select **File -> New** -> **Apex Class.** Add a name, paste the downloaded/copied file from the previous step, and click **Save**.

<figure><img src="https://github.com/solarwinds-cloud/sq-Gitbook/blob/main/.gitbook/assets/21spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-3ca14197ed64ccf905d5ee35f570667d830c83f3%2Fsalesforce_3.png" alt="" width="375"><figcaption></figcaption></figure>

4. Download the [squadcastTrigger.apxt](https://github.com/SquadcastHub/squadcast-salesforce-cloud-integration/blob/master/squadcastTrigger.apxt) file
5. On the **Developer Console** page, select **File** -> **New** -> **Apex Trigger.**\
   \
   Add a name, and choose the **sObject** as **Case**. Paste the downloaded/copied file from the previous step. Then, paste the **Webhook URL** copied previously into the **endpoint field** in the **trigger function** and click **Save**.

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-c68d44aba33476c3f6cc2bb65e93974d9ba050a4%2Fsalesforce_4.png?alt=media)

6. Go back to the Salesforce Cloud page and select **Setup** from Settings. Here, navigate to the **Setup -> Security -> Remote Site Settings** page
7. Add a **new remote site**: name it **Squadcast** and then paste the URL copied previously to the **Remote Site URL** field. Click on **Save**

<figure><img src="https://github.com/solarwinds-cloud/sq-Gitbook/blob/main/.gitbook/assets/21spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-2100e30f088f430e3036c012d0d92e3fd62df160%2Fsalesforce_5.png" alt="Add new remote site in salesforce cloud page" width="563"><figcaption></figcaption></figure>

That is it, you are now good to go!

* Whenever a case is created with a <mark style="color:orange;">`New`</mark>, <mark style="color:orange;">`Working`</mark>, or <mark style="color:orange;">`Escalated`</mark> status, an incident will be created in Squadcast for it.
* When the ticket is moved to `Closed` status in Salesforce Cloud, the corresponding incident will automatically get resolved in Squadcast as well.

*Have any questions?* [*Ask the community*](https://community.squadcast.com/view/home)*.*
