Pages

Sunday, October 26, 2008

Dynamic CRM 4.0 Data Migration Manager validation error - Line breaks

My company are in the process of migrating from Outlook Business Contacts Manager to Microsoft Dynamic CRM 4.0.

I've hit and overcame a few brick walls during this process, which is still ongoing. I've decided to document my findings in case anyone else comes up against the same problems.

The first problem I came up against and probably the most common is line breaks in your field data causes the validation process of the data migration manager to fail. It seems to see a line break as the start of a new field even when your data is surrounded by double quotes.

To be more specific it's a carriage return (Cr) followed by a line feed (Lf) that causes the problems. The only solution that I know of is to replace the CrLf pairs with just a Lf.

This can be easily done in Excel with a macro that you run over your worksheet.

Sub repLF()
Cells.Replace What:=vbCrLf, Replacement:=vbLf, LookAt:=xlPart, _SearchOrder:=xlByColumns, MatchCase:=False, SearchFormat:=False, _ReplaceFormat:=False
End Sub

For me that seems to get rid of most validation errors. I've looked at the imported data in the CRM and it seems to be OK i.e. line break still appear properly.

Hope that helps seem people who are facing the same problem.