As I prepare for my MB2-716 exam I’m producing a series of blog posts that collectively should help others revising for the MB2-716 Certification. (Microsoft Dynamics 365 customization and Configuration.) This time I will look at entity mapping.

Entity mapping is an “extension” to relationships that allows us to map fields. This can be really useful when creating new related records. Consider the process for creating a new contact related to the account. When we do this there are lots of fields that could be usefully defaulted on the new contact. (Including things like phone number and address.)

An important concept with entity mapping is that the mapping only applies when new records are created directly from the parent.

Mapping is NOT designed to keep the fields synchronised it simply defaults them when new records are created. Meaning mapping is never applied on the update of records.

As the fields on the related entity are simply defaulted it does mean that users can edit (or remove) this information before saving. For example, the contacts phone number might usefully be defaulted to match th e account. But sometimes the contact will have a different phone number and this might be changed before saving the contact.

It is possible to map one field on the parent entity to multiple fields on the child entity. To illustrate this I’ve shown how I can map address line 1 on the account to address line 1 of both the shipping address and the bill to address on an order.

It is important to understand that the mapping can only occur when the child record is created directly from the parent. For example, when creating a contact the mapping will only take effect if I first load the account and create the contact from the account form. I have shown this concept below by creating a contact from my account. Notice how the address and phone number fields are pre-populated. This is because they have been defaulted from the values held on my account.

If I have created the contact outside the context of the account this mapping could not and would not have happened.

Data types, when you map a field the data types must match. If you try to try to create an invalid mapping, the error shown below will be displayed.

Take a moment to consider the possible errors mentioned in this error message.

Note : I wanted to review what was implied by the comment “target field must be a field a user can enter data into”. So I did some testing! I thought of three combinations which could come into play here;

  1. The field is read-only on the form … in this circumstance the mapping applied and the child record was correctly saved with the field populated.
  2. The field is not on the form … in this circumstance the mapping applied and the child record was correct saved with the field populated.
  3. The field is restricted using field security profile …. If you map something into a field but you don’t have the security privilege to create that field an error will be given.

Create a Mapping

To create a mapping simply open the parent entity in the customizations area of Dynamics 365. And select the required relationship.


On the relationship you will have the mappings option, use the “New” button to create a mapping.


Having selected “New” you can enter the source and target field information. (Keeping in mind the restrictions on field types (etc) discusses above.


I hope this post has given you a detailed overview of entity mapping in Dynamics 365 and will serve as useful information whilst revising for the MB2-716 exam.

One response to “MB2-716 (Microsoft Dynamics 365 Customization and Configuration) – Entity Mapping”

Leave a comment

Trending

Website Powered by WordPress.com.