Microsoft Dynamics CRM 2011 Instance Adapter – Part 8 – Record Actions

Colin Maitland, 26 June 2013

In this series of blogs, starting with this one, I have written about the Connector for Microsoft Dynamics with an emphasis on integrating data between two Microsoft Dynamics CRM Organisations using the Microsoft Dynamics CRM Instance Adapter

Two blogs ago in this series, I wrote that I would “mention some other findings with respect to the creation, update, delete, deactivate and activate actions for records”. 

In this final blog in this series I discuss these items and will also include Merge and Duplicate Detection Rules. 

 Microsoft Dynamics CRM 2011 Instance Adapter Part 8 Record Actions

• Record Create: When a record is created in the Source Organisation a new record will be created in the Destination Organisation as long as the record is not excluded by any Filters that have been added to the Mapping and as long as the Interface User in the Destination Organisation has the relevant privileges. Plugins and Workflow Processes in the Destination Organisation may be triggered by this action.

• Record Update: When a record is updated in the Source Organisation the corresponding record, if any, will be updated in the Destination Organisation as long as the record is not excluded by any Filters that have been added to the Mapping. If the corresponding record does not exist in the Destination Organisation then one will be created. If the corresponding record existed but was then deleted from the Destination Organisation then it will be recreated. Plugins and Workflow Processes in the Destination Organisation may be triggered by this action. 

• Status Change – Deactivate: When a record is deactivated in the Source Organisation the corresponding record will be deactivated in the Destination Organisation. However, if the corresponding Inactive Status Reason does not exist in the Destination Organisation then the Status Reason of the record in the Destination Organisation will be set to the default Inactive Status Reason. Plugins and Workflow Processes in the Destination Organisation may be triggered by this action.

• Status Change – Activate: When a record is activated in the Source Organisation the corresponding record will be activated in the Destination Organisation. However, if the corresponding Active Status Reason does not exist in the Destination Organisation then the Status Reason of the record in the Destination Organisation will be set to the default Active Status Reason. Plugins and Workflow Processes in the Destination Organisation may be triggered by this action. 

• Record Deletion: Deleting records in the Source Organisation has no impact on any corresponding records in the Destination Organisation; i.e. Corresponding Destination Organisation records are not deleted.


Merge Records:
When records are merged the corresponding records will be merged in the Destination Organisation. Plugins and Workflow Processes in the Destination Organisation may be triggered by this action. 

• Duplicate Detection Rules: Duplicate Detection Rules are not invoked when records are created or updated by the Connector in the Destination Organisation.

Whenever records are created, updated, activated or deactivated in the Destination Organisation any Plugin or Workflow Processes in the Destination Organisation may be triggered. It is very important to be aware of the fact that all Mapped fields are updated in the Destination Organisation whenever any of these events occur, not just the Mapped fields that were updated in the Source Organisation. This results in Plugins and Workflow Processes in the Destination Organisation being triggered by updates to fields in the Destination Organisation even when those fields were not actually updated in the Source Organisation!  

The following screenshot shows and example of entries under System Jobs for a completed Workflow and a completed asynchronous Plugin. These were configured and triggered by an update to only the Account Number of an Account in the Destination Organisation. If the Account Number is included in the list of Mapped fields then this Workflow and Plugin in the Destination Organisation were triggered by updates to the Account even when the Account Number field itself had not been updated in the Source Organisation.

 Microsoft Dynamics CRM 2011 Instance Adapter Part 8 Record Actions

In conclusion, the two most important points to be aware of are the following: 

• All Mapped Fields are updated in the Destination Organisation each time a record is updated in the Source Organisation, not just the fields that were updated in the Source Organisation.

• Because all Mapped Fields are updated in the Destination Organisation each time a record is updated in the Source Organisation, any Plugin or Workflow Processes triggered by changes to updated fields will be invoked even though the field’s value was not actually changed!