Monday, April 30, 2018

Integration of salesforce in Drupal

In this Blog we are going to see how to integrate Salesforce in Drupal, prerequistes  are Salesforce developer account, Salesforce module installed in Drupal CMS.The integration of Salesforce with your Drupal has so many benefits as it helps sales and marketing to work efficiently, 
below are the integration steps. Step 1 Login your Salesforce account.Step 2 Follow the steps:
           Setup->Apps->App manager->New connected App
Follow the steps as shown in the screenshot:

Step 3 Now you can see connected app form, select required fields.
3.1 Basic information: Provide basic information about your app. 
3.2 API (Enable OAuth setting): OAuth (Open Authorization) gives access to resources without revealing user credentials to apps and end user's account information can be used by third-party services. Select setting checkbox. 


Step 4 Check whether the setting is selected or not as it toggles a form with some other required fields. 

Step 5 Enter the callback URL “https://www.yourdomain.com/salesforce/oauth_callback”.
Step 6 Select other fields as per your requirement and process it. Wait for 2-10 minutes before using your app. Now continue the process. Here you will get the consumer key and secret key (these keys are required to connect Drupal to Salesforce). Now you can use the connected app on your Drupal website.

Salesforce module:

Download Salesforce module and install it on your Drupal website. Also, download and install dependent modules like key & encrypt.
Let’s check out the submodules in Salesforce and what they do: 
  • Salesforce: OAUTH2 authorization, wrapper around REST API.
  • Salesforce Mapping: Maps Drupal entities to Salesforce fields, including field level mapping.
  • Salesforce Push: Pushes Drupal entity updates in to Salesforce.
  • Salesforce Pull: Pulls Salesforce object updates into Drupal on cron run.
  • Salesforce Encrypt: This module is dependent on two other module Encrypt & Key so make sure these are installed. Module required for access and refresh token with security.

Setting up Salesforce on Drupal website: 

Step 1 Go to Configuration->Salesforce->Salesforce Authorization 
Step 2 Add the oAuth configuration setting here


Create Salesforce mapping: 
Before Salesforce mapping, make sure what exactly are you looking for. 
Scenario:
Let’s map out basic information, like first name, last name, email of Drupal users to Salesforce and push them to CRM tool. 
Follow this path (admin/structure/salesforce/mappings) to get a form similar to the shown below.

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.
Now select Upsert key and Mapped fields.

Upsert key: By setting Upsert key on Salesforce, you can prevent data duplicacy.Mapped fields: Fill the following columns. Property: Listed Drupal fieldsSalesforce field: Listed Salesforce fieldsDirection: There are three directions on the radio button. Here you can see the mapped data that will be updated on Salesforce or on your Drupal site or will synchronize on both. Your mapped field data depends on this setting. Operations: If you don’t want to map this field then delete it by selecting the ‘delete field option’.I have added Email as an Upsert key and for direction field, select “Drupal to Salesforce”.
Testing Proccess As follows:
Steps 1 Create a user from admin.Note: Salesforce module will automatically push the data on CRM with contacts.  Step 2 Run cron directly to update data with Salesforce contact by using the following path: /admin/config/system/cron 

No comments:

Post a Comment