Skip to main content

How to connect Drupal 9 to Salesforce?

In this blog you will learn how to set up Drupal Salesforce Integration by synchronizing Drupal entities with Salesforce objects. It provides a step-by-step guide to help you create a Salesforce application and connect it with drupal 9. 


Requirements

Create connected app in Salesforce

  • Setup->Apps->App manager->New connected App

    1
  • Provide basic information about your app

  • Enable OAuth settings and add the url callback
    The callback is: /salecesforce/oauth_callback
    2

  • Select the OAuth scopes that you want to enable and place them in selected OAuth scopes
    3

  • After saving the configuration a consumer key and a consumer secret will be generated
    4

 

Drupal Salesforce module

Step 1:

Enable Salesforce submodules:

  • Salesforce

  • Salesforce Mapping

  • Salesforce Push

  • Salesforce Pull

  • Salesforce Encrypt

Step 2:

Configure the module:

  • Go to Configuration->Salesforce->Salesforce Authorization

  • Add the OAuth configuration setting
    5

Create Salesforce mapping

In this case we will try to map drupal users and salesforce contacts.

Step 1: Config drupal

  • Go to admin/structure/salesforce/mappings and add mapping
    6

Now fill the list of values: 

  • Label: Label of the mapping.

  • Drupal Entity: Select users in both of the fields “Drupal Entity Type” and “User Bundle” in order to map out Drupal users. 

  • Salesforce object: Here the selected value should be contacted only.

  • Action Trigger: Ones you create a user on Drupal site, use that as a contact in Salesforce tool. For this, select all the data push actions, like insert, update, delete.
    7

  • Select the fields that you want to map
    8

Step 2: Start mapping data

  • Go to content > salesforce and you will find the mapped objects
    9

  • In salesforce check the list of contacts
    10

Test the mapping

  • Create a drupal user

  • Salesforce module will automatically push the user on CRM with contacts

  • Run the cron directly to update data with Salesforce contacts:
    /admin/config/system/cron