Skip main navigation

Relationship Types 1N – Special

Microsoft Dynamics 365 and the Power Platform

Since that we have learned about Relationship Types 1N in the last step, we are going to continue with relationships but look at Relationship Types 1N – Special in this step.

Common Data Services for Apps have certain types of relationships that do not follow the simple definition of 1:N or N:1 relationship between two entities.

These relationship types add new features and help facilitate better app usability by adding certain capabilities not available if a simple 1:N relationship is used.

Multi-Entity Relationships

There are some cases where the lookup on the related entity may allow for a relationship to more than one type of entity. In other words, the entity on ‘one’ side of the relationship may connect to more than one entity type on ‘many’ side of the relationship. At runtime, the user would typically select the target entity type before searching and selecting the value for the lookup field.

Customer

Customer is a special type of the lookup field that can refer to either a contact or account entity. For example, for a custom entity Project, you may decide that a project sponsor can be a company (account) as well as an individual (contact). When creating this type of relationship, you need to start by creating an attribute of type Customer.

When this attribute is created, in fact, there are two separate 1:N entity relationships created – one from the account entity and another one from the contact entity. You can specify relationship names at creation time and modify properties of each relationship independently of each other.

Image showing special type of the lookup field that can refer to either a contact or account entity

Relationship names cannot be changed once the entity is saved. Selecting meaningful and descriptive names could be very helpful for report designers and developers who use these values. In addition, the system enforces uniqueness on these values across the environment and good name selection will help to make these fields unique.

When this lookup field is used in the apps, the user will be able to link the record to either account or contact.

Owner

The owner lookup field is created automatically for user-owned entities and, like customer lookup, can refer to multiple entities: User or Team, because the records can be owned by either. Again, there are two relationships created – Owning User and Owning Team.

It is possible to create a custom N:1 relationship between an entity and User or Team. However, the system relationships are part of the security model and can be used to control record scope and access permissions.

Activity Party

This is a special relationship between certain types of activities and other entities. They are used to describe entities related to an activity record and allow for multiple references to multiple entities.

The lookups for these relationships are found on the Email entity To and Cc fields. They’re also used in the Phone and Appointment entities to describe various parties like a caller, meeting organiser, attendee, etc. The entity types the activity party can be linked to include entities such as account, contact, user, queue, and custom email-enabled entities.

User Entity Fields

There are several 1:N relationships between the user entity and almost all other entities in the environment. Each record in these entities contains the following lookups – Created By, Modified By, Created By (Delegate), Modified By (Delegate). Values in these fields are updated by the system and cannot be modified directly.

Regarding

When an entity is enabled for activities, there are multiple 1:N relationships automatically created by the system between the entity and all activity entities, e.g. Email, Task, Appointment, etc.

On each of the activity entities, the lookup field is represented by a special regarding lookup that supports linking to any of the activity-enabled entities.

Next up, we continue with Relationship as we discover Relationship Types 1N – Mappings.

This article is from the free online

Dynamics 365: Using Power Platform Applications

Created by
FutureLearn - Learning For Life

Reach your personal and professional goals

Unlock access to hundreds of expert online courses and degrees from top universities and educators to gain accredited qualifications and professional CV-building certificates.

Join over 18 million learners to launch, switch or build upon your career, all at your own pace, across a wide range of topic areas.

Start Learning now