Dynamics CRM 2011 Many-to-One Relationship Behaviour

Paul Nieuwelaar, 28 March 2012

Sometimes when you are creating relationships (lookups) In Dynamics CRM 2011, the relationship behaviour is either overlooked, or just missed out. The Relationship behaviour of a Many to One relationship determines what happens to child records when an action is performed on the parent record. For Example if you delete an Account, should all related child Contacts also be deleted. These options can be set on every Relationship (custom or system created), and can be very important when configuring your business security model.

 Dynamics CRM 2011 Many to One Relationship Behaviour

I thought I would explain how each of these options actually works, as it is not always easy to understand what each one does.

Assign:
When the parent is assigned to another user, the child records are also assigned.

Share/Unshare:
When the parent is shared or unshared, all child records at the time of sharing are also shared. NO NEW CHILD RECORDS ARE SHARED after the parent has been shared.

Reparent:
When the parent is assigned to another user, all child records that are created against the parent will be shared with the owner of the parent record. This includes current and future child records. The owner of the parent record can perform actions on these child records as if they were their own.

Delete:
When the parent is deleted, all child records will be deleted, otherwise you can unlink the children from the deleted parent, or force the user to manually unlink or delete all children before deleting the parent.

Merge:
(Only Applies to Account, Contact, and Lead) When the parent is merged, all child records are combined onto the active parent. This functionality cannot be removed for these entities. For all other entities this is set to cascade none, as merging is not available.

You can also select predefined combinations of these relationship behaviours by selecting the ‘Type of Behavior’. You can select ‘Parental’, which sets everything to ‘Cascade All’, or to ‘Referential’, which sets everything to ‘Cascade None’ (this is set by default for new Relationships). By selecting ‘Configurable Cascading’ you can define your own custom set of behaviours.

It is important to note that each Entity can have only 1 Many-to-One Relationship with Cascading behaviour. This includes Cascade All, Active, and User Owned. This is because a record can have only one parent.

Hopefully that gives you some info about how Relationship Behaviour works. The next time you’re creating a relationship you’ll be able to configure the appropriate behaviour, to make your relationships work better than ever!