CRM 3.0 Bulk Import Wizard

On March 14, 2007, in Dynamics CRM, by Mitch Milam

[via CRM Team Blog]

Greetings Everyone,

The CRM team has given us another great example that allows us to import data into CRM Entities that are not normally supported by the import feature.

It supports most of the common numeric and text-based attributes as well as standard and custom CRM Entities.

You'll need Visual Studio 2005 to compile it into an executable, however.

Beyond just the basic added functionality of this utility, the source code contains a wealth of techniques that any CRM developer will find useful.  Everything from the use of Dynamic Entities, to reading a .CSV file, to the proper use of threading.

You’ll find it here on MSDN: Microsoft Dynamics CRM 3.0: Bulk Import.

This example came at exactly the right time for me as I am implementing custom import processes for three separate customers.  Seems like I owe someone a beer. :)>

Later, Mitch

 

The business card scanning device produced by CardScan is very popular with users of CRM because of the amount of time it saves when entering data from business cards into the CRM system.

Unfortunately, every now and then, something strange happens and data entered into CRM by CardScan "destabilizes" the system.  This instability surfaces when you attempt to synchronize your contacts with Microsoft Outlook. For some reason, the synchronization process will fail, and really not give you a good reason as to why.

 

Root Cause

I was working with Stephen Noe, a Certified CRM  Consultant, Trainer and Project Manager of Business IT Professionals of Cary, NC. to help him identify the problem.

It turns out that the CardScan developers are really, really, sharp and they actually took into account the possibility that someone may have a two-line job title, as shown below:

They actually put both lines into the Contact's Job Title Attribute, which is where the problem occurs.

When CardScan adds the Job Title to CRM, it actually puts a linefeed character as a separator between the two lines of the business card.  If CRM were expecting this, it would not be a big deal, but it isn't so it can't replace the linefeed character with something more compatible with the system.  Add to the fact that CRM utilizes XML for almost all of the data transportation between and around the system, and you create a situation where certain data operations get confused and refuse to work properly until the linefeed character is removed.

 

How do I know if I have corrupted data?

If you would like to check your database directly to see if corrupted data exists within your CRM Contact records, perform the following steps:

1) Open SQL Query Analyzer.

2) Enter and execute the following Query

 

select * from contactbase where jobtitle like '%' + char(10) +'%'

3) If any corrupted records exist, they will be displayed in the Results window.

 

Correcting the Data

This morning I released a simple scan and fix utility to the Premium Content section of my company web site.  It's free, but registration is required.

When you first run the utility, it will offer you a chance to scan the Contacts Entity to locate Job Titles that contain the linefeed character – just like the above SQL script does.

If you wish, you may then choose the Fix any problem records.  The utility will replace the linefeed character with a space and update the Contact records.

 

Feedback

If anyone has any feedback, please let me know.  There could be other Entities and Attributes that could contain similar invalid data so if you run into anything else like this, please let me know so I can modify the utility accordingly.

 

Exporting CRM Attribute Metadata

On March 6, 2007, in Dynamics CRM, by Mitch Milam

I sometimes find it useful to produce a list of Attributes contained within the various CRM Entities.  This is handy for customers who like to use Microsoft Excel to perform data queries and analysis.

This morning I released a new utility that exports a list of Attributes to an XML file that can be read by Microsoft Excel, much like the following figure:

It's in the Premium Content section of my company web site. The utility is free but it does require registration.

Don't forget that you can also view CRM metadata via the CRM Metadata Browser by visiting the following link:

http://[your crm server]/sdk/list.aspx