Question

Let's say that we have two contact entities (the father and the son). I've created a 1:N relation with contact (self referential) and insert the lookup field. When I set the new field to any another contact and try to save, I get this error message:

Error Number: 0x80040386
Error Message: Loop exists in this entity hierarchy.
Error Details: Loop exists in this entity hierarchy.
Source File: Not available
Line Number: Not available

Stack Trace Info: [CrmException: Loop exists in this entity hierarchy.] à Microsoft.Crm.BusinessEntities.ValidateExtension.CheckLoop(Guid parentId, Guid childId, String baseTableName, String referencedAttributePhysicalName, String referencingAttributePhysicalName, ExecutionContext context)

How can I resolve this? Is there any other way to do it? Thanks.

Was it helpful?

Solution

As Pedro said your error is caused by having a circular reference; for example suppose you have Jane who is linked to Lucy, then you try and link Lucy to Jane, that would cause this error. You can also get this when linking to contacts because of a relatipnship they have with another entity type like account.

Look at using relationships, they allow much more flexability for these types of relationships and could be just what you need.

OTHER TIPS

You can't circular references, check if in your hierarchy you have any node that you reference another node in the same hierarchy, either in different levels. In a self referential you can't have reference to nodes in that hierarchy.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top