Ana səhifə

2011 User's Guide Copyright


Yüklə 3.76 Mb.
səhifə165/177
tarix18.07.2016
ölçüsü3.76 Mb.
1   ...   161   162   163   164   165   166   167   168   ...   177

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

  • Share

  • Unshare

  • Reparent

  • Delete

  • Merge

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 relationship. Most Microsoft Dynamics CRM system entities 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 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. 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 (see "Mapping Entity Fields" on page 520)

Create or edit 1:N relationships between entities


Can I do this task?

This task requires the System Administrator or System Customizer security role or equivalent permissions. Customization tasks can be performed only while you are online. More information: Customization Permissions (on page 474)

A 1:N relationship is a hierarchical relationship. More information: Understanding Hierarchical Entity Relationships (on page 572)


  1. In the Navigation Pane, click Settings.

  2. Under Customization, click Customizations.

  3. In the Customization area, click Customize the System.

  4. Under Components, expand Entities, and then expand the entity you want.

  5. Under the entity, click 1:N Relationships.

  6. To edit a relationship or view the details for a relationship, select the relationship, and on the Actions toolbar, click Actions, and then click Edit.

- OR -

To add a new relationship, click the New 1-to-Many Relationship button.



Note

You can't add new relationships to some entities, for example Address or Activity. More information: Understanding Hierarchical Entity Relationships (on page 572)



  1. For a new relationship, in the Relationship Definition section, select the Related Entity. A default Name value will be added after you select the Related Entity. You can accept this name or enter a new one.

Note

If you change theRelated Entity before you save, the value of the Name field will not change. Make sure that this value is meaningful before you save.



  1. In the Lookup Field section, for a new relationship, enter information in the following fields:

  • Display Name

  • Name

  • In the Requirement Level list, you can choose one of the following options:

  1. In the Navigation Pane Item for Primary Entity section, in the Display Option list, you can choose one of the following options:

  • Use Plural Name

  • Use Custom Label

  • Do Not Display

When the Use Plural Name or Use Custom Label options are selected you can choose from the Display Area field to specify where the relationship label will be displayed on the form. You can also specify the Display Order to control where the label will be included within the selected display area. The range of allowed numbers begins with 10,000. Relationships with a lower Display Order value will appear above other relationships with a higher value.

  1. In the Relationship Behavior section, for new relationships and for existing relationships with Type of Behavior set to Parental, you can choose the type of relationship.

What happens when you take an action on this entity is defined by the type of relationship. For Parental, Referential, and Referential, Restrict Delete, the specific behaviors are determined by the relationship type. For Configurable Cascading, you must select the behavior you want for each possible action.

  1. In the Type of Behavior list you can choose one of the following relationship types:

  1. If you selected the Configurable Cascading relationship type, for each of the six actions listed below, you can select the behavior for the action.

If you set all the behaviors for the actions to match the behaviors for the actions for the other relationship types, when you save the relationship, the type of behavior is automatically set to the other type. For example, if you set all the actions to Cascade All, the relationship type is changed from Configurable Cascading to Parental.

  • Assign

  • Share

  • Unshare

  • Reparent

  • Delete

  • Merge

The behaviors for these actions include:

  • Cascade All

  • Cascade None

  • Cascade Active

  • Cascade User-Owned

  • Remove Link

  1. Click Save and Close to close the Relationship form.

  2. When your customizations are complete, publish them:

  • To publish customizations for only the component that you are currently editing, on the Home tab, in the Save group, click Publish.

  • To publish customizations for all unpublished components at one time, click Publish All Customizations.

Notes

  • A custom entity cannot be the primary entity in a relationship with a related system entity that cascades. This means you cannot have a relationship with any action set to Cascade All, Cascade Active, or Cascade User-Owned between a primary custom entity and a related system entity.

  • No new relationship can have any action set to Cascade All, Cascade Active, or Cascade User-Owned if the related entity in that relationship already exists as a related entity in another relationship that has any action set to Cascade All, Cascade Active, or Cascade User-Owned. This avoids relationships that create a multi-parent relationship.

  • Any time you change user interface elements or implement form scripts for an entity, you must publish changes to apply them. Any customizations that change the data schema of Microsoft Dynamics CRM such as custom entities, relationships, or fields are applied immediately.

Related Topics


Understanding Hierarchical Entity Relationships 572

Understanding Entities 499





1   ...   161   162   163   164   165   166   167   168   ...   177


Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©atelim.com 2016
rəhbərliyinə müraciət