Implementing OCR Services in NAV 2017
Introduction: The NAV 2017 has a new feature that uses OCR technology with added item line capture functionality to automate the data entry process for vendor invoices. OCR is an abbreviation for Optical Character Recognition. Lexmark ICS (Invoice Capture Service) provides OCR Services in NAV 2017. The OCR Service feature enables the user to take a picture of a vendor invoice document, sends it to Lexmark ICS Corp. and then imports the invoice back into NAV with the captured details. This saves a lot of time spent on manual entry of data into the system. In this article, we will see how to set up and implement OCR Services in NAV 2017 in three different ways. Prerequisite: Microsoft Dynamics NAV 2017. Lexmark ICS login credentials. Purpose of the Setup: Our goal is to setup and implement the three different ways of using OCR Services in MS Dynamics NAV 2017. Steps: OCR Service by Manual Process: The User will click on Incoming Document option or type ‘Incoming Documents’ to open the Incoming document page. User will have to upload the Document(PDF/Image) that is to be used in the OCR Service by clicking on ‘Create from File’ option which will upload the file to the ‘Main Attachments’ of the Incoming Document in NAV. To Send the document to the OCR Service the user will have to click on the Send to ‘OCR Service’ option. After waiting for some time till the document processing is completed, User will click in the Receive form OCR Service. On receiving the OCR Service, the Financial Details gets updated in Incoming Document. User will Check if the Financial Details received are correct or not If yes, then user will have to click on Create Document option to create purchase Invoice. If no, then user will have to click on Correct OCR Data option and make changes to the required fields and then on Click Send OCR Feedback to correct the OCR Service from making similar errors on future incoming documents. User will the create the purchase invoice by clicking on create document option. Image 1.1 Process from uploading to sending the document using OCR Service in NAV Image 1.2 Process of receiving to creating the document using OCR Service in NAV OCR Service Using NAV Phone Application: In this case of using OCR Service the User uses a camera application instead of manually receiving the document. The User takes a picture of the Invoice Document. (‘Office Lens’ is a The User will upload the document file(Image) into the Incoming Documents in the NAV mobile app. User will then click on Send to OCR Service option once the document is successfully uploaded. After waiting for some time till the document processing is completed, User will click in the. On receiving the OCR Service, the Financial Details gets updated in Incoming Document. User will Check if the Financial Details received are correct or not If yes, then user will have to click on Create Document option to create purchase Invoice. If no, then user will have to click on Correct OCR Data option and make changes to the required fields and then on Click Send OCR Feedback to correct the OCR Service from making similar errors on future incoming documents. User will the create the purchase invoice by clicking on create document option. Image 2.1 Process of Sending Document in OCR Service using NAV Phone Application Image 2.2 Process of Receiving Document OCR Service using NAV Phone Application OCR Service using Email Feature OCR Services can also be performed by sending an Email. Over here the user Emails the softcopy of the Invoice Document as an attachment to the Lexmark ICS Corp. (Note: the user in this case send the email to Lexmark corp. on the email address provided by Lexmark when the user completes the registration on the Lexmark website.) An Incoming document is automatically inserted into the Incoming Document Page once it is processed by Lexmark Corp. (OCR Service Provider) in NAV. The incoming document is already processed when it is created. So User needs to Click on Receive from OCR Service. On receiving the OCR Service, the Financial Details gets updated in Incoming Document. User will Check if the Financial Details received are correct or not If yes, then user will have to click on Create Document option to create purchase Invoice. If no, then user will have to click on Correct OCR Data option and make changes to the required fields and then on Click Send OCR Feedback to correct the OCR Service from making similar errors on future incoming documents. User will the create the purchase invoice by clicking on create document option. Conclusion: The OCR Service in NAV 2017 has benefited by reducing the amount of time spent in the manual work of data entry. The more the OCR Service system is trained the more accurate results can also be obtained. The best use of OCR Service in NAV 2017 is capturing of line items in the document sent to OCR Services.
Share Story :
Implementing OCR Services in Dynamics 365 for Financials
Introduction: The OCR Service technology with added line item capture functionality can be used in the Dynamics 365 for Financials. OCR stands for Optical Character Recognition which enables the user to scan the invoice document and send it to Lexmark Invoice Capture Service(ICS) for OCR Services. This helps the user to reduce a lot of manual work of entering data into the system and also automates the process of obtaining Vendor invoice data. In this article, we will see how to set up and implement OCR Services in Dynamics 365 for Financials. Prerequisite: Microsoft Dynamics NAV 2017. Lexmark ICS login credentials. Purpose of the Setup: Our goal is to setup and implement OCR Services in MS Dynamics 365 for Financials. Steps: Setting up OCR Services in Dynamics 365 Financials The User will have to click the search option Button to the Top Right of the Web Client window. In the search box, the user has to type OCR Service Setup to open the OCR Service Setup page. Fig 1.1 Opening the OCR Service Setup page using search option In the OCR Service Setup page the user will have to will have to enter in the user name, password and authentication key which will be provided to the user once the user has registered to Lexmark Invoice Capture Service(ICS). Once this is done the user will have to test the connection by selecting the Test Connection button. A dialog box will appear once the connection is tested stating whether the connection is successfully established or not. The user has to finally check the Enable checkbox to enable the OCR Services for MS Dynamics 365 for Financials. Fig 1.2 Setting up Credentials for the OCR Service Setup Setting up Line Items In order to capture the line items into purchase invoices in MS Dynamics 365 for Financials the mappings need to be updated by the following steps In Dynamics 365 for Financials, open the Data Exchange Definition page The user will have to save a backup of the OCRINVOICE existing mapping by selecting the ‘Export Data Exchange Definition’ option. After taking a backup of the existing mapping, delete the OCRINVOICE map. Download the new mapping file by using the following link http://docs.readsoftonline.com/store/mapping/NAV_DataExchangeDef_OCRINVOICE_v1102.xml The user has to import the new mapping file by selecting the ‘Import Data Exchange’ option. Fig 2.1 Setting up Line items by changing the mapping of the OCR Service in the Data exchange Definition page Using OCR Services in MS Dynamics 365 for Financials The User will click on Incoming Document option or type ‘Incoming Documents’ to open the Incoming document page. User will have to upload the Document(PDF/Image) that is to be used in the OCR Service by clicking on ‘Create from File’ option which will upload the file to the ‘Main Attachments’ of the Incoming Document in MS Dynamics 365 for Financials. To Send the document to the OCR Service the user will have to click on the Send to ‘OCR Service’ option. After waiting for some time till the document processing is completed, User will click in the Receive form OCR Service. On receiving the OCR Service, the Financial Details gets updated in Incoming Document. User will Check if the Financial Details received are correct or not If yes, then user will have to click on Create Document option to create purchase Invoice. If no, then user will have to click on Correct OCR Data option and make changes to the required fields and then on Click Send OCR Feedback to correct the OCR Service from making similar errors on future incoming documents. User will the create the purchase invoice by clicking on create document option. Fig. 3.1 Uploading the PDF Document of the Invoice into the Incoming Documents Page Fig. 3.2 Sending the Incoming Document to the OCR Service. Fig. 3.3 Receiving Financial Information from the OCR Service. To create a purchase invoice, record the user clicks on the ‘Create Document’ option to generate a purchase invoice record of the OCR read Incoming Document. Fig. 3.4 Creating Document (i.e. Purchase Invoice) of the OCR read Incoming Document Conclusion: The OCR Service option in MS Dynamics 365 for Financials helps to speed up the process rapidly of processing invoices more accurately and gives a better result. The OCR Service provided by Lexmark Invoice Capture Service automates the entire process and saves a lot of time that goes in manually entry of data into the system.
Share Story :
SSO configuration for CRM Portal
Prerequisite Internet facing Domain controller (if it’s an On-Prem DC) Setup the ADFS Role in our Domain Controller [Which will act as a IdP] Dynamic CRM online 2016 and CRM Portal Setting Up ADFS Open the ADFS Management in the server manager [Tool > AD FS Management] In AD FS Management tool, select Service > Claim Descriptions. SSO configuration for CRM Portal Step 1: Add Claim Description Click on Add Claim Description Add Display name as “Persistent Identifier” Add Claim Identifier as “urn:oasis:names:tc:SAML:2.0:nameid-format:persistent” Check the “Publish this claim description in federation metadata as a claim type that this Federation Service can accept” Check then “Publish this claim description in federation metadata as a claim type that this Federation Service can send” Click on Save. Step 2: Add Relying Party trust Go to Trust Relationships >Relying Party Trust Click on Add Relying Party Trust Click on Start Select “Enter data about the relying party manually” and then Click Next Enter “Display Name” then Click Next Select “AD FS Profile” then Click Next In configure Setup Leave the setting as it is and just click Next. In Configure URL Select “Enable support for the SAML 2.0 WebSSO protocol” and add URL https://YourPrortalURL/Signin-saml2 [Append the “Signin-saml2” to your portal URL it’s an CRM portal internal URL which will internally manage the SAML Authorization]. In Configure Multifactor Authentication Just click Next as here we are not focused on multifactor authentication. In Choose Issuance Authorization Rules, select “Permit all users to access this relying party”, click Next In Ready to Add Trust, Click Next. Finally Click Close. When we close it open another dialog for setup the claim rule. Click On “Add Rule” In claim rule template select “Transform an incoming Claim” Select Incoming Claim Type as “Window Account Name” Select Outgoing Claim Type as “Name ID” Select Outgoing Name ID format “Persistent Identifier” [ created in 1st step] Select “Pass through all Claim Values” Then click on Finish. Setting in CRM Portal (Site Setting) Login to CRM Using admin OR Customizer role, then go to Portal Site setting as Shown below, In site setting add below 4 records to enable SSO using AD FS, before that make sure Authentication/Registration/ExternalLoginEnabled is set to “True”. Add New Site setting as “Authentication/SAML2/ADFS/MetadataAddress” where value of this setting will be https://adfs_domain/FederationMetadata/2007-06/FederationMetadata.xml Just append the “FederationMetadata/2007-06/FederationMetadata.xml” to your AD FS domain name also make sure your AD FS has “Https” “Authentication/SAML2/ADFS/AuthenticationType” where value of this setting will be https://adfs_domain/adfs/services/trust Just append the “adfs/services/trust” to your AD FS domain name “Authentication/SAML2/ADFS/ServiceProviderRealm” where the value will be your portal URL. “Authentication/SAML2/ADFS/AssertionConsumerServiceUrl” where value will be “https://portalURL/signin-saml2” After this setting just restart you CRM Portal, then you can use SSO in Your Portal.
Share Story :
Dynamics CRM- Rollup with Custom Hierarchies
CRM Custom hierarchies are very useful feature for maintaining hierarchy among records and also provide nice visualization of the Hierarchies. With rollup fields and custom hierarchies have become even more useful to derive and visualize meaningful data in the hierarchy. In this blog, we will use how to leverage Rollup fields and Custom hierarchies to get proper data and avoid redundancy and custom calculations. Problem statement: Suppose you have a custom hierarchy of campaign, so a campaign can have multiple child campaigns. Each campaign has leads associated to it. The requirement is to get the count of all the leads of the related child campaigns and also itself. Solution: If you want count of leads on the campaign, we can easily create a rollup field on Campaign to get the count of leads on Campaign. The rollup field will look like below: You can see the count of leads using the above rollup below on the campaign form: Get total lead count of child campaigns on Parent Campaign Without hierarchy to achieve this, we would need to write a custom plugin or JavaScript to get the lead count of all the child campaigns and set it on the parent campaign. With rollup using hierarchy, we can get this done without any calculations. See below the rollup definition for this. Note that we have now enabled “Use Hierarchy” in the rollup definition. This will get us the count of all leads including Child campaign as well. See the form now with the updated rollup definition, the lead count is now “8” which is the sum of lead count of all child campaigns. Conclusion: Leveraging Calculated fields, rollup fields and custom hierarchies we can easily build good and simple solutions, avoid custom calculations and redundant fields.
Share Story :
How to remove business process flows from existing records?
Problem Statement Many times we come to a scenario where clients ask to remove business process flows from the production environments. In such scenarios, there are chances that on the existing records, the business process flows are already set on the records. Hence even if we deactivate the business processes, we still see a yellow ribbon as per below screenshot: So, how to fix this issue? Solution First of all, we should not directly delete the business processes as clients might ask to reactivate the same and we don’t want to rework on the complex logic we have already implemented. So, to remove above issue while keeping backup of the business process, we will have to follow below steps: Go to Setting > Processes Select the business process flow and deactivate it. Open Business process flow and click on the Save As option from the top ribbon. Delete the old business process flow. After following above steps, you should be able to see that, business process section from existing records is removed and no warnings are shown at the same time, we have backup of the process which we can reactivate in future if needed.
Share Story :
Business Process Flows in CRM
Business Process Flows are role based process flows that guides user to navigate between entities as per the requirements. i.e. they guide users to have a step by step process divided in different stages and each stage contains different set of fields where user can enter data. Business Process Flow can also be enhanced with branching using “If-Else Logic” and “Logical Expressions” (AND or OR) Operators. Also Branching Rule can only contain AND or OR Operator but not both operators together. NOTE: Each Business Process Flow can contain no more than 30 stages. In Multi Entity Process, max 5 entities can be selected. Below is the example which we tried implementing for a Pharmaceutical Manufacturing Company to enhance their productivity with streamlined user experience. Here we created the Business Process Flow which guides user to create Inquiries, Sample Request Form, Document Request and Invoices based on different branching logic. Pre-Requisites In the backend, for custom entities, Business Process needs to be enabled on Entity Level. To enable Business Process Flow for certain users, it can be done as shown in below image. Example: Marketing Team creates Inquiry (Opportunity) with required details and once it is created, Marketing Team proceeds to create Quotations for Products for the Inquiry was raised by clicking on Next Stage. Once Quotations are created, based on branching logic of whether Samples or Documents is needed, the stage alters. So If Quote Accepted = Yes and Sample Required= Yes, the next stage is Sampling Stage. Or if Quote Accepted= Yes and Sample Request = Yes and Document Request = Yes, the next stages are Sampling and Regulatory Stage. Or if Quote Accepted = Yes and Document Request = Yes, then there is no Sampling Stage as the next stage. So as seen above, we can see how based on different criteria and conditions the stages changes. These conditions can be defined as per the user’s Business Logic. Conclusion: Thus by using Business Process Flow we can guide user to navigate between different entities and complete the streamlined process and improve the productivity of the company.
Share Story :
Integrating Data to Multiple Dynamics AX7 Legal Entities using TIBCO Cloud Integration
Introduction: A single Microsoft Dynamics AX7 database can contain multiple individual company accounts. Each company account in an application uses the same application logic, but has its own set of data for tables. Data that is stored in one company account cannot be accessed from other companies. So, for Integrating data into these multiple individual company accounts, some procedures need to be followed. In this article, we will integrate Customers from Microsoft Dynamics CRM Online to multiple legal entities (companies) in Dynamics AX7, using the TIBCO Cloud Integration as an integration tool. Prerequisite: Microsoft Dynamics CRM Online. Dynamics AX7. TIBCO Cloud Integration Subscription. Purpose of the Setup: Our goal is to integrate Data from Microsoft Dynamics CRM Online to Multiple Companies which are setup in Dynamics AX7 through Batched Process. (It can be done in Real time as well). Steps: Configure a connection for your Microsoft Dynamics CRM Online by providing the required information. Configure a connection for your Dynamics AX7 by providing the required information. In the Company Name field of the connector: You can specify any legal entity name which is present in Dynamics AX7. Or You can specify your company name. We will consider two scenarios: Steps for creating records in multiple companies in Dynamics AX7:Scenario 1: We will create a Customer in CRM Online and integrate it to “DAT” Company of Dynamics AX7. Create a new Solution and specify the Solution name and the Agent. Note: Here, we are using a Cloud Agent. Now create an Advance Map for integrating Customers from CRM Online to Dynamics AX7. Source: Microsoft Dynamics CRM Online Target: Dynamics AX7 While mapping the fields, in dataAreaId field of Dynamics AX specify the legal entity name of AX7 for which the customers should be integrated. Note: In Dynamics AX7 table, the legal entity name for each record is stored in dataAreaId field. Test the Map by creating a Customer in CRM Online and then run the above Solution in TIBCO Cloud Integration. Now go into Dynamics AX7(DAT Company), you can see the customer has been integrated from CRM. Conclusion: If a dataAreaId field is specified, then records will be created in AX7 for that company (irrelevant to the company name specified in the TIBCO Cloud Integration AX Connector) If a dataAreaId field of AX is not specified, then the records will be created in AX for the company specified in the TIBCO Cloud Integration AX Connector. If company name in TIBCO Cloud Integration AX Connector is not present in Dynamics AX7, no records will be created and Scribe will give the following error: Steps for fetching records from multiple companies in Dynamics AX7:Scenario: We will create two Customers in Dynamics AX7 for two different companies (DAT and USMF) and integrate it to CRM Online. Create a new Advance Maps and specify Source and Target Connection. Source: Dynamics AX7. Target: Microsoft Dynamics CRM Online. In the Query block, mention filter criteria as: dataAreaId = “dat “ or dataAreaId =” usmf” Create Customers in Dynamics AX7; one customer in “DAT” company and another in “USMF”. Run the above Map from Scribe. Now go into CRM, you can see the customer has been integrated from Dynamics AX7. Conclusion: If a dataAreaId is not specified, records are fetched from AX7 of the company which is specified in the TIBCO Cloud Integration AX Connector. If a dataAreaId is specified, records are fetched from AX7 of the company which is specified in dataAreaId field. (irrelevant to the company name specified in the TIBCO Cloud Integration AX Connector or User Company Name)
Share Story :
Download SharePoint file programmatically without sharing it – Dynamics CRM and ADX portal or custom portal
This blog intends to able to download a SharePoint file without sharing it using Dynamics CRM and (optionally on-prem ADX portal since we can use below approach in custom portal as well). Many times we come across scenarios where we want to share SharePoint documents with end users on web portals without give them sharing access from SharePoint. Prerequisite CRM online SharePoint online Web portal code access (ADX on-prem or custom portal). Step 1: Enable SharePoint integration with CRM. Step 2: Custom code to access SharePoint document. Add the following code on the page where you want to show list of SharePoint documents to the end user. CS file code: DataTable dt = new DataTable(); var password = new SecureString(); foreach (var c in “yourpassword”.ToCharArray()) password.AppendChar(c); ClientContext cxt = new ClientContext(“https://yourdomain.sharepoint.com/Site1”); cxt.Credentials = new SharePointOnlineCredentials(“Username”, password); List list = cxt.Web.Lists.GetByTitle(“Document Sharing”); cxt.Load(list); cxt.Load(list.RootFolder); cxt.Load(list.RootFolder.Folders); cxt.Load(list.RootFolder.Files); cxt.ExecuteQuery(); FolderCollection fcol = list.RootFolder.Folders; List<string> lstFile = new List<string>(); DataRow dr; foreach (Folder f in fcol) { if (f.Name == relativeURL) //relative url of the file. { cxt.Load(f.Files); cxt.ExecuteQuery(); FileCollection fileCol = f.Files; foreach (File file in fileCol) { dr = dt.NewRow(); lstFile.Add(file.Name); dr[“fileName”] = file.Name.ToString(); dr[“createdOn”] = file.TimeCreated.ToShortDateString(); dr[“fileURL”] = @”javascript:downLoadFile(‘” + file.ServerRelativeUrl.ToString() + “‘)”; //Append Javascript function to the row. dt.Rows.Add(dr); } } } GridView2.DataSource = dt; //GridView2 being a grid added on your .aspx page. GridView2.DataBind(); GridView2.DataSource = dt; //GridView2 being a grid added on your .aspx page. GridView2.DataBind(); GridView2 in .aspx page: //Javascript function <script type=”text/javascript”> function downLoadFile(link) { window.open(“DownloadFile?url=” + link, “_blank”); } </script> //GridView Code <asp:GridView ID=”GridView2″ runat=”server” Visible=”true” AutoGenerateColumns=”False” BorderWidth=”1px” BackColor=”White” GridLines=”Vertical” CellPadding=”4″ BorderStyle=”None” BorderColor=”#DEDFDE” ForeColor=”Black”> <FooterStyle BackColor=”#CCCC99″> <PagerStyle ForeColor=”Black” HorizontalAlign=”Right” BackColor=”#F7F7DE”> <HeaderStyle ForeColor=”White” Font-Bold=”True” BackColor=”#6B696B”> <AlternatingRowStyle BackColor=”White”></asp:BoundField> <asp:TemplateField HeaderText=”File Name” HeaderStyle-Width=”10%” ItemStyle-Width=”10%” FooterStyle-Width=”10%”> <ItemTemplate> <%# Eval(“fileName”) %> </ItemTemplate> </asp:TemplateField> <asp:BoundField HeaderText=”Created On” DataField=”createdOn” HeaderStyle-Width=”5%” ItemStyle-Width=”5%” FooterStyle-Width=”5%”></asp:BoundField> </Columns> <SelectedRowStyle ForeColor=”White” Font-Bold=”True” BackColor=”#CE5D5A”></SelectedRowStyle> <RowStyle BackColor=”#F7F7DE”></RowStyle> </asp:GridView> Download File: Add a new blank .aspx page to the portal named ‘DownloadFile.aspx’. This page will act as bridge for portal to connect to SharePoint and authenticate for being able to download the file. This file will contain code to authenticate the SharePoint connection for the portal to be able to download the file. DownloadFile.aspx.cs protected void Page_Load(object sender, EventArgs e) { string partialURL = “”; partialURL = Convert.ToString(Request.QueryString[“url”]); downloadFile(partialURL); } private void downloadFile(string relativeURL) { ClientContext cxt = new ClientContext(“https://yourdomain.sharepoint.com/Site1”); var password = new SecureString(); foreach (var c in “password”.ToCharArray()) password.AppendChar(c); cxt.Credentials = new SharePointOnlineCredentials(“username”, password); int pos = relativeURL.LastIndexOf(“/”) + 1; var fileRef = relativeURL; var fileInfo = Microsoft.SharePoint.Client.File.OpenBinaryDirect(cxt, fileRef); var fileName = relativeURL.Substring(pos, relativeURL.Length – pos); using (var fileStream = new System.IO.MemoryStream()) { int extpos = fileName.LastIndexOf(“.”) + 1; fileInfo.Stream.CopyTo(fileStream); StreamToFileAttachment(fileStream, fileName); } } void StreamToFileAttachment(Stream str, string fileName) { byte[] byteBuffer = new byte[str.Length]; str.Position = 0; Response.AddHeader(“Content-Disposition”, “attachment; filename=\”” + fileName + “\””); Response.AddHeader(“Content-Length”, str.Length.ToString()); Response.ContentType = “application/octet-stream”; int len = 0; while ((len = str.Read(byteBuffer, 0, byteBuffer.Length)) > 0) { { Response.BinaryWrite(byteBuffer); } Response.Flush(); } } Conclusion Using above code we can download SharePoint Document without actually sharing document with the end user.
Share Story :
Contractor access in PM Solution
Summary This feature enables administrator to provide access to contractor using Project Management solution. User (contractor) should be able to see only assigned projects, tasks, billing codes and easily be able to enter time against project. User will not able to see any value in money fields present on project/task/billing code. If User want to see any money related field, then administrator have ability to customize this requirement according to business need. Only system administrator and manager will able to view all fields value present on project, project task and billing code. Pre- Requisites 1. User with system administrator role in CRM 2. Project Management solution should be installed. If you don’t have solution, please contact support@cloudfronts.com or navigate to for more information. Steps 1. Create user in Office 365 and assigned CRM licenced. (e.g. CRM Essential) 2. Assigned PSM Core role and PSM Project Team Member to user. 3. We will go through two different scenarios in Project Management solution When Contractor logged into the CRM When Manager/Administrator logged into the CRM Scenario 1: When Contractor logged into the CRM In current scenario user mihir kadam(contractor) is logged in to the CRM. Mihir kadam will able to see only limited entities and web resources based on security permission. We can customize this as per requirement. Click on Project Entity to see what all details are visible to the user. Mihir kadam is able to view only one project because he has added as team member to only one project by project manager (Kuldeep Gupta). In project entity view, following fields are empty because user does not have enough permission to view this fields. 1. Actual revenue 2. Total budget If Mihir kadam want to do time entry for any project, then he has to navigate to Timesheet from project management navigation menu. Scenario 2: When Manager/Administrator logged into the CRM In current scenario user Kuldeep Gupta(Manager) is logged in to the CRM. Kuldeep Gupta will able to see all entities and web resources based on security permission. Click on Project Entity to see what all details are visible to the user. Kuldeep Gupta is able to view only all projects but modification is allowed only for owned project. Open record to view more details about project. If you notice Kuldeep Gupta is able to read all information including Total budget and actual revenue. Conclusion By using Contractor access in Project management solution any outside consultant can do time entry for ongoing project without knowing company’s actual revenue/ budget/ rate.
Share Story :
Salesforce → CRM real-time Integration
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. 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. 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). Once we configure outbound message, we will use the WSDL generated by outbound message and create a web service which will perform below operations: Consume the outbound message Connect to Dynamics CRM Create/update record in Dynamics CRM as per outbound message. 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 Login to Salesforce environment. Create Workflow Rule as per below screenshot (More about workflow rules). Name: Give any rule name which is easy to understand purpose of the workflow rule. Object: Select Account object as we are doing integration for Account create/update. Select Evaluation Criteria as ‘Evaluate the rule when a record is created, and every time it’s edited. In Rule Criteria section, Select Run this rule if the following as ‘formula evaluates to true’. In formula, put 1 = 1 and click on Save. We are putting this condition to allow all records and not filter any. Add an outbound message as an action as per below screenshot in the workflow rule. Name: Give any name which is easy to understand purpose of the message. Object: Select Account. Endpoint URL: <hosted web service URL with asmx extension at the end> Select Send Session ID checkbox. Select All Columns. 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 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
