TUTORIAL: Relationship Mappings

In this tutorial we will look at a neat feature that should always be considered when setting up relationships between entities. This feature is mappings. It allows us to map data from one entity to another. The idea behind this is to simply speed up data entry. It is important to note that mappings only work in one direction for both 1:N and N:1 relationships. Mappings are always pushed from one to the many. For example to map Account address to a new contacts address fields, you must create the contact from within the account entity.

Let’s look at an example, in the relationship accounts to contact (1:N) we have default mappings setup to push address details from account to the contact. This means that if we choose to create a new contact from within our account record the account address details are automatically populated for us on the contact record. This saves us having to re-enter any address details which are susceptible to human error.

Creating Mappings

We can create mappings by

  • Navigate to your solution or base customisations where your entity exists.
  • Find the relationship you want to add the mappings to. You may filter on mappable items.
  • Select Mappings. It is import to note that it is possible to alter an existing mapping by simply selecting the mapping and opening it. For this tutorial however we shall create a new mapping.
  • Select New.
  • Select the fields you want to map from and to.
  • Select ok, Save and Close and publish.
Quick Tip

Quick Tip

Always start from the “one” side of the relationship as it make understanding the direction of your mapping easier.

Quick Tip

Quick Tip

Mapped types don’t always have to be the same. For example you can map an optionset from one entity to a text field on another entity.

Quick Tip

Quick Tip

When mapping optionsets make sure the values in both optionsets are the same for the same labels.

Information

Automatically Generate Mappings

There is an option under mapping to automatically generate them. Running this operation will delete all the current mappings for that relationship and replace them with new mappings. New mappings are created where the target and reference types and schema names of the fields are the same. I would not use this operation unless you are happy that you have designed and developed all your field names correctly. However, even then I would not recommend using the feature.

This concludes the tutorial on mappings.

Leave a Reply

Your email address will not be published. Required fields are marked *