CRM 2011 Import Custom Entities and Related Data

1 April 2011

In this example were showing how you can Import/Synchronise data from a SQL Server Database into an instance of CRM 2011 with custom entitles and Data Synchronisation Studio.

We're going to import Sales Order History from the Adventure Works database and relate each Order History line to an Account in the CRM system.

Using the Query below we can pull out the Sales Order Header Lines and in this example we are going to relate the Contact ID back to the Account in CRM (previously we imported the Contacts into the Account Entity using the rowguid as the accountid in the CRM system)

Query

This is the typical result we get from the Query

Result

Next we create a new Entity in CRM with 2 custom fields, Amount and Account:

Amount Field

Amount

Account Field

Account

We can then simply map the Data in Data Sync between the Source SQL Query and CRM entity like this.

Data Sync

Schema Map

Schema

Compare and Sync the Data

Compare

Once the Data is imported you can then create a view to view the list of Sales or records.

View

Sales order item showing Account Relationship connected.

Relationship

| |