Dynamics CRM

Parent Previous Next


Dynamics CRM Destination


The Dynamics CRM Destination is used for writing data to a table in a Dynamics CRM server. See the Dynamics CRM Connection Manager page to learn more about setting up the connection manager. Task Factory currently supports the following versions of Dynamics CRM: 4.0, 2011, 2013, 2015, 2016.



  Connection - Using the drop down menu, create or select a connection manager for the Dynamics CRM server.

  Action -Choose the desired action.

o   Insert - Insert new rows into the Dynamics Entity

o   Update - Update rows that already exist in the Dynamics Entity

o   Delete - Delete existing rows from the Dynamics Entity

o   Upsert - Upsert is used to insert new rows into the Dynamics Entity, or update rows that already exist.

  Detect Duplicate Rows - When this option is enabled, the destination will check for duplicate rows based on the data duplication rules on the CRM Server. The rows will be handled according to the setting "How to handle errors" setting  

  Dynamics Entity - This field displays all of the available tables in the Dynamics server

  Map Dynamics Destination Columns  - Set up desired mappings


Upsert Modes

The Upsert mode of Dynamics has two modes.


Primary Key Column Mapped  

If the primary key from entity is mapped to a column from the source, the destination will look for NULL values in the source data. If the source data for the primary key is NULL, then an insert will be executed. If the primary key is NOT NULL then an update is executed. For an Update to work the primary key column value from the source MUST be the primary key value from the Dynamics entity. For instance, the Account entity primary key column is "AccountID". This column must be mapped to be in "Primary Key Mapped" mode.


If "Detect Duplicate Rows" is checked an insert will be attempted. However, if a "Duplicate Data" rule on the dynamics server detects a duplicate row, the data in the current row that would have been inserted will instead be updated.


To give you an example of this let's assume your Account entity on Dynamics has a Duplicate Data rule on the "Name" column. We have an account named "Pragmatic Works" in the Dynamics Account entity. If a row with the account name of "Pragmatic Works" from your source is sent to the server as an insert (because the primary key value is null) then the Dynamics Server will reject the insert but the Dynamics Destination component will then take the current row from the source and update the row in the Dynamics Account entity. If this behavior is NOT DESIRED then "Detect Duplicate Rows" should be turned off.


If "Detect Duplicate Rows" is unchecked and duplicate data is detected on the server the row will be rejected and an error will be thrown.


Primary Key Column Not Mapped

In this mode, the primary key is not mapped and only the "Duplicate Data" rules on the Dynamic server are used. For each row from the source an insert is attempted on the server.


If "Detect Duplicate Rows" is checked and a duplicate row is detected on the Dynamics server based on the Duplicate Data rule then an update to the row detected as a duplicate on the dynamics server will be updated.


To give you an example of this let's assume your Account entity on Dynamics has a Duplicate Data rule on the "Name" column. We have an account named "Pragmatic Works" in the Dynamics Account entity. If a row with the account name of "Pragmatic Works" from your source is sent to the server and a duplicate row is detected on the Dynamics Server the row will be rejected as an insert and treated as update.


If "Detect Duplicate Rows" is unchecked and a duplicate row is detected on the Dynamics server based on the Duplicate Data rule then an error will be thrown.


Please see the Error Row Handling page for more information about this functionality.