› Dynamics CRM › Salesforce → CRM real-time Integration

Salesforce → CRM real-time Integration

 Yadnyesh Kuvalekar   Leave a comment

Introduction

This article is 2nd part of the blog published earlier on CRM and Salesforce integration. In earlier blog, we have seen how we can do real-time integration from Dynamics CRM to Salesforce. In this blog we will see how to do real-time integration from Salesforce to Dynamics CRM.

Requirements

Let’s assume a real world example. Contoso company tracks their Accounts and Contact details in Salesforce and customer care in Dynamics CRM. So they want allow creation of Accounts and Contacts in Salesforce and those should get created in Dynamics CRM in real-time. Also, they want to handle any Account/Contact update to be reflected in Dynamics CRM.

Implementation Approach

Below are the steps we will follow to do this integration for an Account entity.

  1. To trigger integration from Salesforce, we will implement a workflow rule in Salesforce on an Account object. We will configure this workflow to get triggered on Account creation or update.
  2. Add an Outbound Message as an action in above workflow rule to pass the data to integration service which will actually do the integration. The integration service will be hosted on either azure environment or externally accessible web server (e.g. IIS).
  3. Once we configure outbound message, we will use the WSDL generated by outbound message and create a web service which will perform below operations:
    1. Consume the outbound message
    2. Connect to Dynamics CRM
    3. Create/update record in Dynamics CRM as per outbound message.
    4. Log integration details.

In this way, we can achieve real-time integration from Salesforce to CRM without modifying any Salesforce object or without having need to understand Salesforce query language.

Implementation Steps

  1. Login to Salesforce environment.
  2. Create Workflow Rule as per below screenshot (More about workflow rules).

    1. Name: Give any rule name which is easy to understand purpose of the workflow rule.
    2. Object: Select Account object as we are doing integration for Account create/update.
    3. Select Evaluation Criteria as ‘Evaluate the rule when a record is created, and every time it’s edited.
    4. In Rule Criteria section,
      1. Select Run this rule if the following as ‘formula evaluates to true’.
      2. In formula, put 1 = 1 and click on Save. We are putting this condition to allow all records and not filter any.
  3. Add an outbound message as an action as per below screenshot in the workflow rule.

    1. Name: Give any name which is easy to understand purpose of the message.
    2. Object: Select Account.
    3. Endpoint URL: <hosted web service URL with asmx extension at the end>
    4. Select Send Session ID checkbox.
    5. Select All Columns.
  4. Once created, you need to create a web service project. Use below link to do the same.
    https://developer.salesforce.com/page/Creating_an_Outbound_Messaging_Notification_Service_with_CSharp_and_.Net_Framework_2.0
  5. Once you are ready with above ASMX web service, write C# code to connect to CRM and consume the Outbound message as shown in above blog.

 

Functional Flow chart

 


Liked it? Share it.

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload the CAPTCHA.