How to Create 1N Relationship Types in Dynamics 365
- One record of a primary entity
- Zero, one, or many records of a related entity
- Related entity has a lookup field to store unique identifier of a primary entity
Creating 1:N RelationshipBefore you create a custom 1:N entity relationship, evaluate whether using an existing entity relationship, provided by a Common Data Model, would meet your requirements. There are two designers you can use to create and edit 1:N (one-to-many) or N:1 (many-to-one) relationships:
- PowerApps portal (Web.powerapps.com): Provides an easy streamlined experience, but some settings may not be available.
- Classic Solution explorer: Classic experience, provides for more flexibility for less common requirements (discussed later in the lesson). Examples of less common requirements include:
- Navigation pane options for model-driven app
- Whether the relationship is hidden in advanced find
- Field mappings (discussed later in the lesson)
- Relationship behaviors (discussed later in the lesson)
- Hierarchical relationship (discussed later in the lesson)
PowerApps PortalWhen creating a 1:N or N:1 relationship in PowerApps portal, you can specify information for the following fields:
|Lookup field display name||The localisable text for the lookup field that will be created on the related entity. This can be edited later.|
|Lookup field name||The name for the Lookup field that will be created on the related entity.|
|Relationship name||The name for the relationship that will be created.|
|Lookup field description||The description for the lookup field. In model-driven apps this will appear as a tooltip when people hover their mouse over the field. This can be edited later.|
Want to keep
CloudSwyft Global Systems, Inc. online course,
Dynamics 365: Using Power Platform Applications
- Required: Defines whether the lookup must have data before a form in a model-driven app can be saved, e.g. if the contact must have a link to the parent employer company.
- Searchable: Defines whether this lookup field should be visible within Advanced Find in model-driven apps. Unselect the checkbox if you do not want this field to be available in Advanced Find conditions when working with the entity on N side of the relationship.
Classic Solution ExplorerSolution explorer provides an alternative to edit 1:N or N:1 entity relationships for Common Data Service for Apps because certain options can only be set using solution explorer. These additional properties are grouped by the sections that follow.
Relationship DefinitionsThese properties provide additional information about the relationship.
|Searchable||Whether this relationship should be visible within Advanced Find in model-driven apps. Select No if you don’t want the relationship to be available in Advanced Find when working with the conditions for the entity on 1 side of the relationship. Note that visibility of the relationship in Advanced Find is different from visibility of the lookup field discussed earlier.|
|Hierarchical||This option is enabled only for self-referential relationships discussed later in the lesson.|
Navigation Pane Item for Primary EntityFrom the primary entity you can navigate to see related records. This data is used by model-driven apps to control how the related entity records are displayed.
- Field: Display Option – How the related entity list should be displayed:
- Do not Display. Hides the related entities for this relationship.
- Use Custom Label. When this option is chosen, the Custom Label field is enabled so that you can specify the localisable text to be used instead of the plural name.
- Use Plural Name. Use the plural display name defined for the related entity.
- Field: Custom Label – Specify the localisable text to be used instead of the plural name when you select Use Custom Label as the Display Option.
- Field: Display Area – Select one of the available groupings to display this list. The available options are: Details (for the Common group), Marketing, Sales, and Service.
- Field: Display Order – Controls where the navigation item will be included within the selected display area. The range of allowed numbers begins with 10,000. Navigation pane items with a lower value appear above other relationships with a higher value.
Delete RelationshipsWhile viewing entity relationships in PowerApps portal, select the relationship you want to delete. You can use the Delete relationship command from the command bar or from the row context menu when you click the ellipses. Deleting the relationship will delete the lookup field and the data it contains on the related entity. Note: You will not be able to delete a relationship that has dependencies. For example, if you have added the lookup field to a form for the related entity, you must remove the field from the form and publish the form before you delete the relationship.
Dynamics 365: Using Power Platform Applications
Our purpose is to transform access to education.
We offer a diverse selection of courses from leading universities and cultural institutions from around the world. These are delivered one step at a time, and are accessible on mobile, tablet and desktop, so you can fit learning around your life.
We believe learning should be an enjoyable, social experience, so our courses offer the opportunity to discuss what you’re learning with others as you go, helping you make fresh discoveries and form new ideas.
You can unlock new opportunities with unlimited access to hundreds of online short courses for a year by subscribing to our Unlimited package. Build your knowledge with top universities and organisations.