Microsoft Dynamics CRM 2011 Instance Adapter – Part 5 – Mappings

Colin Maitland, 11 April 2013

In this blog I will discuss the options provided in the Microsoft Dynamics Connector for Mapping Destination fields.  There are five options. The following screenshot shows the three most common options. A fourth option is to not Map selected Destination fields and a fifth option is to Map all Destination fields using a single shortcut.

Microsoft Dynamics CRM 2011 Instance Adapter Part 5 Mappings 

• Map All Destination Fields For The Entity Using ‘\’. All Destination fields for the Entity may be Mapped to their equivalent Source fields by simply entering a backslash ‘\’ character as a shortcut into the Mapping column of the row for the Destination Entity. The following screenshot shows an example where the backslash character has been used to Map all Destination fields for the Contact Entity.

 

Microsoft Dynamics CRM 2011 Instance Adapter Part 5 Mappings


• Map Destination Fields Individually Using Map To A Source Field. Destination fields may be individually Mapped to corresponding Source fields. In these cases, the corresponding Source field does not necessarily need to be the same field in both systems. However, the Destination fields should normally be of a compatible data type and size and should have a compatible set of properties defined for it such as Minimum Value, Maximum Value, Precision Options and Maxim Length etc.

When mapping Option Set fields it is important that values from the Source Option Set can be mapped to corresponding values in the Destination Option Set. This can be done by Mapping the field, Mapping the Name or by Mapping the Value. The following screenshot shows an example of the Mapping options for the Address 1: Address Type Option Set field in the Contact Entity. In each case any of the Mapping options may be used; I.e. Map to a Source Field, Use a Constant, Use a Function and Do Not Map.


Microsoft Dynamics CRM 2011 Instance Adapter Part 5 Mappings

Microsoft Dynamics CRM 2011 Instance Adapter Part 5 Mappings 

The following screenshot shows an example where each Destination field has been individually Mapped for the Contact Entity.


Microsoft Dynamics CRM 2011 Instance Adapter Part 5 Mappings 

For example: The following screenshots show the sequence of steps to be completed for Mapping the Address 1: Country/Region field.


Microsoft Dynamics CRM 2011 Instance Adapter Part 5 Mappings

Microsoft Dynamics CRM 2011 Instance Adapter Part 5 Mappings

Microsoft Dynamics CRM 2011 Instance Adapter Part 5 Mappings

Microsoft Dynamics CRM 2011 Instance Adapter Part 5 Mappings

• Leave Individual Destination Fields Unmapped. Selected Destination fields may be left unmapped. The following screenshot shows an example where the Destination Fax, ID, Latitude, Longitude, Phone, Primary Contact Name, Telephone 2, Telephone 3, UPS Zone and UTC Offset fields for Address 1 have been left unmapped.

 

Microsoft Dynamics CRM 2011 Instance Adapter Part 5 Mappings

• Map Destination Fields Individually Using A Constant. A Constant may be used to set a Destination field to a specific Text, Character, Number or Boolean value. The following screenshots show an example of the steps required to configure the Destination Address 1: Country/Region field to be set to “New Zealand” using a Constant.


Microsoft Dynamics CRM 2011 Instance Adapter Part 5 Mappings

Microsoft Dynamics CRM 2011 Instance Adapter Part 5 Mappings

Microsoft Dynamics CRM 2011 Instance Adapter Part 5 Mappings

Microsoft Dynamics CRM 2011 Instance Adapter Part 5 Mappings

• Map Destination Fields Individually Using A Function. The following screenshot shows an example where a function has been used. In this case the Trim function has been used to remove leading and trailing occurrences of white space from the fields the function has been applied to.


Microsoft Dynamics CRM 2011 Instance Adapter Part 5 Mappings

When mapping fields using functions you will be prompted to provide the function arguments that the function requires. In the case of the Trim() function only one function argument is required. The following screenshots show the steps to use the Trim function with the Address 1: Country/Region field.


Microsoft Dynamics CRM 2011 Instance Adapter Part 5 Mappings

Microsoft Dynamics CRM 2011 Instance Adapter Part 5 Mappings

Microsoft Dynamics CRM 2011 Instance Adapter Part 5 Mappings 

Some functions require a single function argument and other functions require multiple function arguments. For example, the GetFormattedPhoneNumber() function, which builds a standard US Phone Number using the separators provided, requires up to  eight function arguments to be provided.

Microsoft Dynamics CRM 2011 Instance Adapter Part 5 Mappings 

There are a number of functions available. These are categorized into six categories as follows: 

• Date. There are 21 predefined Date functions. The following screenshot shows some of these:

 

Microsoft Dynamics CRM 2011 Instance Adapter Part 5 Mappings

• General. There are 27 predefined General functions. The following screenshot shows some of these:

 

Microsoft Dynamics CRM 2011 Instance Adapter Part 5 Mappings 

• Logical. There are 16 predefined Logical functions. The following screenshot shows some of these:
 

Microsoft Dynamics CRM 2011 Instance Adapter Part 5 Mappings

• Math. There are 16 predefined Math functions. The following screenshot shows some of these:
 

Microsoft Dynamics CRM 2011 Instance Adapter Part 5 Mappings

• Regular Expression.

 

Microsoft Dynamics CRM 2011 Instance Adapter Part 5 Mappings 

• String. There are 27 predefined String functions. The following screenshot shows some of these:
 
Microsoft Dynamics CRM 2011 Instance Adapter Part 5 Mappings 

There are also Connector specific functions as shown in the following screenshot:


Microsoft Dynamics CRM 2011 Instance Adapter Part 5 Mappings

Microsoft Dynamics CRM 2011 Instance Adapter Part 5 Mappings

In conclusion, the Mapping options provided by the Microsoft Dynamics Connector enable the configuration of how information is to be migrated or synchronised from a source Microsoft Dynamics CRM Organisation to a destination Microsoft Dynamics CRM Organisation on an Entity by Entity basis a fairly straight forward process. Using the Microsoft Dynamics Connector provides flexibility and eliminates the need, in many situations, for the development of a custom migration and/or integration between two instances of Microsoft Dynamics CRM using programming.