Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!

How to create and use a Microsoft Dynamic CRM custom entity with Talend components

No ratings
cancel
Showing results for 
Search instead for 
Did you mean: 
TalendSolutionExpert
Contributor II
Contributor II

How to create and use a Microsoft Dynamic CRM custom entity with Talend components

Last Update:

Jan 22, 2024 9:35:30 PM

Updated By:

Jamie_Gregory

Created date:

Apr 1, 2021 6:23:03 AM

This article discusses the difference between CRM on Premise and Cloud, then focuses on the usage of Talend with Microsoft Dynamic CRM in general but with cloud in particular. For a cloud connection, it will show how to create the native application and get all the value for the field that are needed.

Content:

 

Prerequisite

To create a Microsoft Dynamic CRM custom entity, you must have a Microsoft Dynamic CRM administration account.

CRM on Premise vs Online

What is the difference?

CRM Online: This is a SaaS model. If you choose CRM Online, this means that your CRM system will be in Microsoft’s Cloud.

Benefits of CRM Online

  • You get immediate access to new features for Dynamics CRM as soon as they are released. Microsoft currently releases two major updates a year for CRM Online.
  • You will get some features that are ONLY available in CRM Online.
  • No falling behind on versions—Microsoft requires you to update regularly, which prevents you from falling multiple versions behind. This prevents a large and time-consuming upgrade project in the future.
  • Less upfront and ongoing costs because you don’t need the IT infrastructure or maintenance.
  • With online hosting, you pay a monthly fee instead of paying all at once. It requires less cash up front.
  • CRM Online is secure and reliable, and has a super-robust disaster recovery scenario that few on-premises customers can afford to create.

CRM On-premise: This traditional mode is where CRM is hosted by your company or by another hosting partner/vendor.

Benefits of CRM On-premise

  • You have access to the SQL database.
  • You have the ability to run SQL queries and reports.
  • If you run into performance issues, you can add more hardware for it since you are responsible for the infrastructure.
  • You decide precisely when and if you want to upgrade.
  • You can run old code that does not run in CRM online.
  • You decide on, and have control of, security and setup.

Step by step Azure Native application creation

To connect Talend Studio with Microsoft CRM cloud version, you need to create a native application that you will use in your Talend component to be able to connect. Below are the steps:

  1. Log in to the Azure portal: https://portal.azure.com.

  2. Enter the username and password, then the screen of Microsoft Azure screen appears. 0693p000008u82aAAA.jpg

  3. Click Azure Active Directory.

  4. Click App registrations.

    0693p000008u81TAAQ.jpg

  5. Click New application registration.

    0693p000008u82kAAA.jpg

  6. Click Create to create a Native Web App. Enter a Name (for example, kb_test_native_app1), click the drop-down and choose Native, then enter the Redirect URI (for example, http://localhost)

    0693p000008u82pAAA.png

  7. Click Create to create a Native App.

  8. Scroll down then click kb_test_native_app1.

    0693p000008u82CAAQ.jpg

  9. Click Required permissions.

    0693p000008u7pOAAQ.png

    The Application ID is shown above. You will need it in the tMicrosoftCrmInput/tMicrosoftCrmOutput components to connect CRM 2016 ODATA.

  10. Click Grant Permissions to grant access permission.

    0693p000008u834AAA.png

  11. Click Add to add application.

    0693p000008u839AAA.png

  12. Click Select an API, then choose Dynamics CRM Online to add Dynamics CRM Online.

    0693p000008u83EAAQ.png

  13. Click Select, then Done.

  14. Check the box next to Access CRM Online as organization users.

    0693p000008u7rPAAQ.png

  15. Click Select, then Done.

    0693p000008u83TAAQ.png

  16. Permission is granted for the Windows Azure Active Directory and Dynamics CRM Online.

    0693p000008u83YAAQ.png

    After all these steps you are set to connect to your CRM in cloud using your username, password and the application ID that you just created. But to insert data into your custom entity you need to create and grant all the needed permissions, as shown in the next steps.

Create a CRM custom entity

Once you are done with the application creation, follow these steps to create the custom entity that you will be using.

Note: Assume you already have an online Microsoft Dynamics CRM account access granted.

  1. Log into Office by clicking on the URL https://www.office.com

  2. Click Open the app launcher to access Office 365 apps.

    0693p000008u83dAAA.png

  3. Click Get more apps.

    0693p000008u7zwAAA.png

  4. Click Dynamics 365 to add a Dynamics CRM.

    0693p000008u83nAAA.png

     

  5. Login into the Dynamics CRM by copying and pasting the URL https://home.dynamics.com/.

  6. Click Dynamics 365.

    0693p000008u80lAAA.png

  7. After logging in, click the drop-down arrow in Sales:

    0693p000008u84CAAQ.png

     

  8. Click Settings.

    0693p000008u7nEAAQ.png

  9. Click Customizations.

    0693p000008u84RAAQ.png

  10. Click Customize the System.

    0693p000008u7glAAA.png

  11. A new window will appear as shown below:

    0693p000008u84NAAQ.png

  12. Expand the arrow next to Entities:

    0693p000008u84WAAQ.png

  13. Click the drop-down arrow next to New, then choose Entity.

    0693p000008u84OAAQ.png

  14. The following window will appear. Fill in the entity name and the display and permission as shown below:

    0693p000008u84bAAA.png

  15. Then click Save and close.

Create custom fields

  1. Scroll down and expand the entity just created (for example, test_employee2).

    0693p000008u7mZAAQ.png

  2. Click Fields, then click New.

    0693p000008u84qAAA.png

  3. Enter the field name (for example, firstname), the data type, and the field type. Click Save and New to create another field name.

    0693p000008u84vAAA.png

  4. Name the new field lastname, then click Save and Close.

  5. You will see that the two new fields you just created are highlighted:

    0693p000008u7x2AAA.png

Create forms

  1. Click Forms, then click New > Main Form.

    0693p000008u850AAA.png

  2. The New Form window will appear. Drag firstname and lastname from the Field Explorer on the right to the General pane as shown below:

    0693p000008u7oUAAQ.jpg

  3. Click the entity you just created (test_employee2) then click Publish to publish the entity.

    0693p000008u7moAAA.png

Set access permissions for the custom entity

  1. Click the checkbox next to Access Teams to set the access permission for the test_employee2 entity.

    0693p000008u85AAAQ.png

  2. Check that test_employee2 appears in Sales.

    0693p000008u7mpAAA.png

How to connect Talend to your CRM?

The following example discusses the online scenario with 2011 and 2016 just to illustrate. The connection to your on-premise CRM will just require the credentials and host to connect.

Connection to online Microsoft Dynamic CRM 2011

To connect, drag and drop your CRM component and fill out the requirement field. But behind the scenes, the following points are what you need to know:

  • When you enter the password in the UI, it encrypts and decrypts the password.
  • It collects the username, organizeName, and encrypted password, then invokes the MSCRMClient object and passes the credentials to it.
  • It collects the service endpoint URL from the UI, invokes the MSCRMClient.getOnlineConnection(), then passes the service endpoint URL to it.
  • The org.talend.ms.crm.MSCRMClient object collects all above credentials, then invokes the Microsoft authenticate method in the SecurityData object to connect to the Microsoft Dynamics CRM 2011.

    0693p000008u7rQAAQ.png

     

Connection to online Microsoft Dynamic CRM 2016 (ODATA connection)

Here Talend will be using the ODATA protocol to communicate with your CRM. Below are what is happening behind the scenes:

  • When you enter the password in the UI, it encrypts and decrypts the password.
  • It collects the Application ID, username, decrypted password, and the authorization endpoint, then passes them into the org.talend.ms.crm.odata.ClientConfiguration constructor for setting. The org.talend.ms.crm.odata.ClientConfiguration object is the set class.
  • It invokes the org.talend.ms.crm.odata.DynamicsCRMClient object, then passes it in the class variable, the Service Root URL, and the entity name (for example, accounts).
  • The org.talend.ms.crm.odata.DynamicsCRMClient object invokes the Microsoft AuthenticationContext.acquireToken() to get the connection.

    0693p000008u7cvAAA.jpg

 

Talend with CRM: Example Job

CRM 2011
  1. Input column names in the schema to write data to the new_test_employee2 custom entity.

    0693p000008u7oWAAQ.png

  2. Job output:

    0693p000008u7lmAAA.png

     

CRM 2016 ODATA: Using the application created
  1. Write data to CRM 2016 ODATA:

    0693p000008u85ZAAQ.png

  2. Job output:

    0693p000008u85jAAA.png

  3. Read data from CRM 2016 ODATA:

    0693p000008u80aAAA.png

  4. Job output

    0693p000008u83zAAA.png

 

Debugging tips

For any connection issues you may encounter during your testing, below are a few pointers that can help you in your debugging:

Online Microsoft Dynamics CRM 2011

  • Verify Microsoft Dynamics CRM access permission.
  • Verify the login credentials such as username, password, and OrganizeName.
  • Verify the Discovery service endpoint URL.

Online Microsoft Dynamics CRM 2016 (ODATA)

  • Verify Microsoft Dynamics CRM access permission.
  • Verify the Application ID.
  • Verify the service root URL.
  • Verify the OAuth authorization endpoint URL.
  • Increase the Time out.

On Premise CRM

  • Verify the WebService URL.
  • Verify the login credentials such as username, password, and OrganizeName.
  • Verify the domain, host, and the port number.
Labels (2)
Version history
Last update:
‎2024-01-22 09:35 PM
Updated by: