Activity Parties in Dynamics CRM are one of the most complex entities to work with regarding data migration. If you don’t know, activity parties are the entities that contain the relevant data for the party list fields on Emails, Appointments, etc. (Check out some additional information about this entity, which have been around for quite a while.) These fields typically have more than one record associated to them, and the activity party entity record for the field contains this data pointer. The nature of this relationship makes them rather difficult for data migrations, and information is not terribly plentiful, so let’s chat about them!
Let’s take email records, for example. We have several activity party types we will need to work with here: the To:, Cc:, and Bcc: fields being the main ones. For each email record we migrate into CRM, we need to associate the To, Cc, and Bcc fields with the appropriate activity party record to get them migrated in with the proper recipient data.
There are a couple ways you can do this:
- The best way to do this is to migrate the email records over to from the source to target CRM with the same GUID on both sides. Then you can simply run a migration of Activity Party records and directly associate the GUIDs. This is in effect taking a replica of the data in the source CRM and migrating it to the target CRM, keeping everything the same. You would map activity party ActivityID, PartyID, and PartyTypeCode to one another directly. You would then set the activityfieldname to be the field you want records written for (ie. To, Cc, or Bcc). You would need to change this value for each run to get all records over, as if you specify To, then Cc and Bcc will fail, and you will have to run them next.
- You could also try to define logic to incorporate all these fields into one mapping, if you would prefer. ActivityTypeCode would be set to 4210 for emails. Also ensure that your PartyObjectTypeCode is identical to the source, else you will have to create a file lookup to mitigate differences.
If you do not have the luxury of maintaining the same GUIDs as the source CRM, you can do this in a different way. The different way would be to first do an Insert or Insert Update of the Email record, and then as a second step, do an Insert of the associated activity party record. You cannot update activity party records, however.
As always, if you have any questions on how to do this, PowerObjects Scribe wizards are available to help!