Hierarchical entity relationships require that one of the records have a field to store a unique identifier that references another record. The record that stores the reference to another record is called the child record A record in a hierarchical relationship with a parent record where a reference to the parent record is stored in the record. One parent record can be related to many child records. Child records have lookup fields in the form to allow them to be related to a parent record.. The record referenced by the unique identifier in the child record is called the parent record A record that is in a hierarchical relationship with a child record, where a reference to the record is stored in the child record. One parent record can be related to many child records..
A hierarchical relationship allows each child record A record in a hierarchical relationship with a parent record where a reference to the parent record is stored in the record. One parent record can be related to many child records. Child records have lookup fields in the form to allow them to be related to a parent record. to store a reference to one parent record A record that is in a hierarchical relationship with a child record, where a reference to the record is stored in the child record. One parent record can be related to many child records.. A parent record can be referenced by an unlimited number of child records. The parent record can display all the child records in an associated view The view of an entity that is displayed in the forms of other entities. The associated view is different from the views that are visible for the entity in its own area of the user interface. For example, in an account record under Information, click Contacts to view and open a contact form. That is the Contacts associated view. There can be only one associated view of each entity..
Defining Relationships
Relationships are defined between entities. The entity that will represent the child records is called the related entity An entity that is associated with a primary entity (record type) through a unique reference defined by using a lookup control on the related entity form. For example, an account has a unique reference to a primary contact.. A relationship attribute An attribute that exists in a related entity when a hierarchical relationship exists. When added to the form of the related entity, a lookup control is displayed to allow the record to be related to another record as defined in the relationship., also known as a lookup attribute An attribute used to create a reference to a related record. Also known as a relationship field., is created on the related entity to allow records to store a reference to a parent record. The entity that represents the parent records is called the primary entity The entity that a related entity is associated to. Sometimes called a parent entity. in the relationship.
A 1:N Relationship is created or viewed from the primary entity. Any one record from the primary entity can be referenced by many records from the related entity.
A N:1 Relationship is created or viewed from the related entity. Many records from the related entity can reference any one record from the primary entity.
Data Integrity
A hierarchical relationship introduces the opportunity to define rules for data integrity. For example, an opportunity A potential revenue-generating event or sale to an account that needs to be tracked through a sales process to completion. record has no meaning if it isn't associated with a customer record. Microsoft Dynamics CRM requires that an opportunity record be related to a customer record. However, a task activity An action to be performed, such as a task, or a communication item that is sent or received, for example, e-mail, phone calls, and appointments. The status of activities is tracked and the activity history is stored in the system, so users can view the open and closed activities. can be meaningful whether it is associated to another record or not. Relating a task activity to another record is optional.
When you create a relationship, you must choose whether to enforce rules for data integrity. If you make the relationship field on the related entity required by setting a requirement level A setting that determines whether users must enter data. For example, when the requirement level of a field is set to Business Required, users will be unable to save the record without entering data in that field. The field will also appear in the Quick Create form. of Business Required, you can guarantee that each of the related entity records created through the Microsoft Dynamics CRM application will be related to a record of the parent entity.
Relationship Behavior
Once you create a hierarchical relationship, you can control how the relationship behaves to support data integrity and business rules for your organization. The relationship can control how actions performed on a parent record cascades down to a child record.
You can configure the relationship behavior for the following actions performed on the primary entity record:
Assign The related records will be assigned to the same user.
Share The related entity records will also be shared with the same user or team.
Unshare The related entity records will no longer be shared with the same user or team.
Reparent If the owner of the primary entity record changes because the primary entity record was reparented, the owner of any related records will be set to the same owner as the primary entity record.
Delete The related records can be deleted, unlinked from the primary entity record, or the delete action can be canceled.
Merge The related records associated with the subordinate record will be reparented to the master record.
Choose from three predefined and commonly used types of behavior, or choose to configure the cascading action performed on the record of the primary entity.
The three predefined types of behavior are:
Parental. All actions cascade down to the child records. Deleting a parent record also deletes all child records. Reassigning a parent record to a user also reassigns all the child records to the same user.
Referential. No actions cascade down to the child records. Deleting a parent record also deletes any linking data in any child record.
Referential, Restrict Delete. No actions cascade down to the child records, except that deletion is not allowed if there are any child records.
Also choose to define specific cascading behavior for each of the actions. For most actions, your choices are:
Cascade All. This is a parental type of behavior. All actions cascade down to all child records, including inactive records.
Cascade Active. All actions only cascade down to all active child records.
Cascade User-Owned. Actions only cascade down to child records assigned to the same user as the owner of the parent record.
Cascade None. This a referential type of behavior. No actions cascade down to child records.
Data integrity must be preserved when data in records changes or when the status of records change. Deleting a parent record breaks the data integrity of any child record if the relationship is required. There are three ways to address this:
Use Referential, Restrict Delete behavior to prevent the deletion of any record with a child record.
Use Parental behavior to delete any child record when deleting a parent record.
Set the Delete action to Cascade All or Referential, Restrict Delete.
If the relationship is not required, it is sufficient to remove the data that establishes the link to the deleted parent record.
In addition to data integrity, your business can apply relationship behavior when data in records change or when the status of records change. The relationship behavior can cascade this action so it does not need to be done manually.
Limitations for Hierarchical Relationships
Each entity can have only one parental A relationship between entities in which any action taken on a record of the parent entity is also taken on any child entity records that are related to the parent entity record. For example, if you delete a record in the parent entity, the related child entity records are also deleted; or if you share a parent entity record, the related records from the child entity are also shared. relationship. Most Microsoft Dynamics CRM system entities System entities, while a part of Microsoft Dynamics CRM by default, cannot be customized or added to a solution. System entities do not display in the Customization area. already have a parental relationship and this relationship cannot be changed.
Entities can have referential relationships with any entity, including business entities. You can create multiple relationships between two entities. Entities can have referential relationships with themselves, allowing linked records of the same type. However, a record cannot be linked to itself.
In Microsoft Dynamics CRM, the customer entities are Accounts or Contacts. These two entities together represent a composite Customer The account or contact with which a business unit conducts a business transaction. entity. Some Microsoft Dynamics CRM business entities, such as Opportunity and Case must be related to a Customer. However, you cannot create this type of relationship with custom entities.
Mapping
Users can create new child records in an associated view The view of an entity that is displayed in the forms of other entities. The associated view is different from the views that are visible for the entity in its own area of the user interface. For example, in an account record under Information, click Contacts to view and open a contact form. That is the Contacts associated view. There can be only one associated view of each entity.. When this happens, data from the parent record is copied into the form for the new child record. By default, a reference to the parent record is always copied to the relationship lookup field in the child record. You can choose whether data from other fields should be copied at the same time. More information: Mapping Entity Attributes