Archive for April 2012

The Story of the Import & The Inactive Record

Howdy,

Ok, so i was transferring a bunch of records with lookup field linked to contacts and accounts from an old CRM 4 deployment to our new CRM 2011 deployment. I was trying to do this the quick and easy way……exporting records to excel.

A large number of the records imported ok but a large number failed due to a “duplicate lookup reference exists". Now, this normally means, especially in the case of a contact record that you have 2 “John Smith” records and the import does not know which one to resolve the newly imported record too. However, i searched and only 1 John Smith record came up?!……

So, then i remembered that we had recently ran a duplicate contact clean-up job on our contact records using the de-dupe process to find the duplicates and merging the records together. So i searched for John Smith but this time i searched for both Inactive and Active records and voila! 2 records!



So, first point, by doing this i discovered that the when resolving lookup references, the import process includes deactivated records and as far as i can see there is no way to turn this feature off. So, after being mad at MS for a while, i eventually realised that actually this wasn't a bad idea, especially when migrating historical data. However, my issue was, how do i get around it?!

I realised that i needed to adjust the inactive contact records in such a way that they wouldn't be picked up by the import process which basically meant, changing the name on all the inactive records. But i also wanted to change it back again. So, i went for the following:
  1. Create 2 x new fields on the contact entity (don't have to put them on the form) called “Old First Name” and “Old Last Name”
  2. Wrote an OnDemand workflow that first of all, takes the values of the “First Name” and “Last Name” fields and populates them into the newly created fields above. The workflow will then clear the “First Name” and “Last Name” fields. This thus changes the full name to blank.
  3. Ran an advanced find to show all inactive contact records.
  4. Ran my workflow in step 2.
  5. Carried out my import (successfully as my newly imported records only resolved to active contacts)
  6. Wrote another workflow that takes the values of the “Old First Name” and “Old Last Name” fields and populates them into the “First Name” and “Last Name” fields. The workflow will then clear the “Old First Name” and “Old Last Name” fields. This thus changes the full name back to what it should be.
  7. Ran an advanced find to show all inactive contact records (again)
  8. Ran my step 6 workflow.
Some may see this as an ingenious approach whilst others long winded but it did the trick! Couple of points…
  • If like me, you aren't bothered about changing the names of the deactivated contacts back from Blank you can stop at step 5
  • If you wish to go through this process but only with a relevant sub-set of deactivated records you can obviously define this in the Advanced Finds (steps 3 & 7)
Hope this helps and if you have read to this point…..well done for sticking with it!

Ta

xRM Consultant
Monday 9 April 2012
Posted by XRM Consultant

Search This Blog

Popular Post

About xRM Consultant.com

Having worked with Microsoft Dynamics CRM 4.0 in a sales & development environment, my focus now is on customising this awesome solution and showing its true potential.
Powered by Blogger.

- Copyright © xRM Consultant -Metrominimalist- Powered by Blogger - Designed by Johanes Djogan -