This project is read-only.
Project Description
Microsoft CRM 4.0 Tool that lets you export N:N relationships and import them.

Background
Microsoft does not have an import tool to import many to many (N-N) relationships into the CRM database, and you cannot (and should not!) directly insert into the CRM Database itself. I have written this simple tool to take a comma seperated file containing the keys of the entities involved in the N - N relationship and import them into the appropriate relationship table that exists in the CRM Database.

Runtime Requirements
.NET Framework 3.5 SP1 (32-bit CRM dll's & compiled exectuable included)

Sourcode Requirements
Visual Studio 2010

Features
Allows you to export a comma seperated file of GUID Entity Key values into a text file
Allows you to import a comma seperated file of GUID Entity Key values into a CRM N-N table.

Usage
This a command line app.

To Export, simply run the application with the following command line:

CRMAssocManyToMany.exe export "<server url>" "<org name>" "<destination N-N table>" "<Entity Type 1>" "<Entity Type 2>" "<Export File Path/name>" 

To Import, simply run the application with the following command line:

 CRMAssocManyToMany.exe import "<server url>" "<org name>" "<destination N-N table>" "<Entity Type 1>" "<Entity Type 2>" "<Import File Path/name>" 

For example, the following command line inserts the keys (GUIDs) from the C:\Import.txt table into the contactleads_association many to many table, and indicates that the first column in the file is "lead" entity keys and the second column contains "contact" entity keys.

CRMAssocManyToMany.exe import "http://CRM:5555" "MyOrg" "contactleads_association" "lead" "contact" "C:\Import.txt" 

Import File Specification example line (CSV):

<Entity Type 1 GUID Key>,<Entity Type 2 GUID Key>

Where <Entity Type X GUID key> corresponds to the entity name at either side of the N:N relationship; Note that these must be in the same order as the "<Entity Type 1>" and "<Entity Type 2>" paremeters on the command line.

Notes:
  • Do not include a column name line in the file.
  • Do not wrap GUID values in quotes

Last edited Mar 29, 2012 at 9:10 PM by mhunter, version 16