Microsoft Dynamics CRM 2011 Instance Adapter – Part 6 – Sample Data Integration – Part 1

Colin Maitland, 25 April 2013

In my previous blog I wrote about the options for Mapping fields when creating integration between two Microsoft Dynamics CRM Organisations using the Microsoft Dynamics CRM Instance Adapter.  

In this blog I will be writing about some requirements for integrating the Sample Data between two Microsoft Dynamics CRM Organisations.

Microsoft Dynamics CRM 2011 Instance Adapter Part 6 Sample Data Integration Part 1  

The following screenshot shows a list of the Sample Data that may be installed using Settings, Data Management, Sample Data in Microsoft Dynamics CRM 2011.


Microsoft Dynamics CRM 2011 Instance Adapter Part 6 Sample Data Integration Part 1  

When configuring integrations between two Microsoft Dynamics CRM Organisations it is important to ensure that Parent records exist/created in the destination Organisation prior to the integration of dependent Child records.  The following diagram shows the relationships that exist in the Sample Data. 

 Microsoft Dynamics CRM 2011 Instance Adapter Part 6 Sample Data Integration Part 1  

There are a number of Parent/Child relationships: 

• Account to Case
• Account to Contact
• Account to Opportunity
• Account to Opportunity
• Campaign to Lead
• Case to Case Resolution
• Case to Phone Call
• Case to Task
• Contact to Account
• Contact to Case
• Subject to Article
• Subject to Case
• Subject to Subject

 

It is important to ensure that the Data Maps are ordered/scheduled in such a way that Parent records are created prior to dependent Child records. For the Sample Data, the following order should suffice: 

• 1. Campaign
• 2. Lead

 

• 3. [1] Subject (The Default Subject already exists in Microsoft Dynamics CRM 2011).
• 4. Article (Parent Article Templates already exist in Microsoft Dynamics CRM 2011).

 

• 5. [1] Account
• 6. [1]Contact

 

• 7. Opportunity
• 8. Case
• 9. Case Resolution
• 10. Phone Call
• 11. Task

 

• 12. [2] Goal (Parent Goal Metrics already exist in Microsoft Dynamics CRM 2011).

 

[1] There is a potential issue here, because there are recursive relationships between Account and Contact and between Subject and Subject. 

[2] It is important to ensure that prior to importing the Goals that the Fiscal Year Settings in the Destination Organisation is set to use the Quarterly Fiscal Period Template. 

It is assumed that all records to be integrated will be owned by either the Destination Organisation Integration User, or a User/Team in the Destination Organisation with the same Name as the User/Team in the Source Organisation. The Microsoft Dynamics CRM Instance Adapter attempts to match Users and/or Teams by their Name.  

The Connector has a built in mechanism for retrying the integration of records up to seven times over successive periods of time. This allows for related Parent records to be subsequently created in between the retry attempts for the dependent Child records. The following Status messages may be recorded in the Log for the Data Map: 

• Attempting to integrate - This record is in a retry state and will continue to retry integration until it either integrates successfully or the maximum number of retries (7) is reached. If the maximum number of retries is reached and the record does not successfully integrate, the status will change to Failed to integrate. You can double-click the message to view the message details where you can stop retrying, or reset retries.

• Integrated after initial error – This record was originally in a retry state and was able to successfully integrate on one of the successive retry attempts.

• Failed to integrate – This record was unable to successfully integrate.

 

As a simple test I chose to integrate Subjects and Articles:

 Microsoft Dynamics CRM 2011 Instance Adapter Part 6 Sample Data Integration Part 1 

• Subject

 Microsoft Dynamics CRM 2011 Instance Adapter Part 6 Sample Data Integration Part 1 

 Article

 Microsoft Dynamics CRM 2011 Instance Adapter Part 6 Sample Data Integration Part 1 

I set the Check For Data Modified After settings to 1/01/2013:

 Microsoft Dynamics CRM 2011 Instance Adapter Part 6 Sample Data Integration Part 1 

After starting the Connector for Microsoft Dynamics CRM Service, the records for these entities were successfully synchronised from the source Organisation to the destination Organisation. The following information was recorded in the Log:

 Microsoft Dynamics CRM 2011 Instance Adapter Part 6 Sample Data Integration Part 1 

However, I discovered that the Default Subject record was duplicated in the Destination Organisation.

 Microsoft Dynamics CRM 2011 Instance Adapter Part 6 Sample Data Integration Part 1 

This was because it already existed in the destination Organisation. I then retested after setting the Check For Data Modified After settings to a date/time after that on which the source Organisation was created but before that on which the Sample Data was installed.

 Microsoft Dynamics CRM 2011 Instance Adapter Part 6 Sample Data Integration Part 1

 Microsoft Dynamics CRM 2011 Instance Adapter Part 6 Sample Data Integration Part 1

In my next blog I will summarise my findings for the integration of the Article records and continue my review of using the Dynamics CRM Instance Adapter to integrate the Sample Data.