locked
Spouse Field - Parental Association Loop Error RRS feed

  • Question

  • Here's an interesting one.  Let's say that you have two contacts in your database and they are married (Contact 1 and Contact 2).  You create a new field called Spouse that is a lookup field to the contact table.  So your relationship is between the contact table and the contact table.

    In Contact 1, you set the spouse field to Contact 2.

    In Contact 2, you set the spouse field to Contact 1 and try to save.  When you try to save, you get the following error.  I understand what it means but it was a big shock that you can't do this.  I thought that I would share with everyone and ask if anyone else has come up with a good workaround using connections or something.

    Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Creating this parental association would create a loop in this entity hierarchy.Detail:
    <OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">
      <ErrorCode>-2147220601</ErrorCode>
      <ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
      <Message>Creating this parental association would create a loop in this entity hierarchy.</Message>
      <Timestamp>2012-04-04T22:47:27.9423281Z</Timestamp>
      <InnerFault i:nil="true" />
      <TraceText i:nil="true" />
    </OrganizationServiceFault>

    Thursday, April 5, 2012 2:49 PM

Answers

  • Thanks for sharing.. Never realized Dynamics does not support circular references, but, apparently, it does not. For the connections, I would probably add a subgrid to the contact entity which I might call "family connections", and that subgrid would be displaying all connections of that contact record that fall into the "family" connection role (so, basically, that would require a new view for the connections entity that would utilize additional filter):

    


    Alex Shlega, GotchaHunter.Net



    Thursday, April 5, 2012 6:53 PM

All replies

  • Thanks for sharing.. Never realized Dynamics does not support circular references, but, apparently, it does not. For the connections, I would probably add a subgrid to the contact entity which I might call "family connections", and that subgrid would be displaying all connections of that contact record that fall into the "family" connection role (so, basically, that would require a new view for the connections entity that would utilize additional filter):

    


    Alex Shlega, GotchaHunter.Net



    Thursday, April 5, 2012 6:53 PM
  • Interesting.  I had not thought about creating a filtered view like that for connections. 
    Thursday, April 5, 2012 7:54 PM
  • Hi ,

    I Have also same problem.

    Please tell me how to solve this problem. 

    How can i do?

    Help me.

    Thursday, January 14, 2016 7:23 AM