Customer Engagement & Dynamics CRM Forum

 View Only
Expand all | Collapse all

Issue with reciprocal lookup field for spouses - can't associate records due to parental relationship

  • 1.  Issue with reciprocal lookup field for spouses - can't associate records due to parental relationship

    GOLD CONTRIBUTOR
    Posted 5 days ago

    I have field on the contact record called "Spouse Lookup". This is a lookup field to the contact table, so N(Contact):1(Contact).

    I can populate the field just fine on one record - Spouse A has Spouse B in the Spouse Lookup field - but when I try to add the other spouse - Spouse B has Spouse A in the Spouse Lookup field - I get the following error:

    "Cannot associate records

    This lookup creates a parental relationship between records and you attempted to link this record to itself. This is not allowed because it would create a circular reference. You can link this record to other records of the same type, but not the same record."

    Why is this? Can I not have two records reference each other with a referential lookup relationship?



    ------------------------------
    Lucas Hewitt
    Enterprise Application Specialist
    Ethnos360
    ------------------------------


  • 2.  RE: Issue with reciprocal lookup field for spouses - can't associate records due to parental relationship

    TOP CONTRIBUTOR
    Posted 4 days ago
    I tried this and got the same message!

    ------------------------------
    Donal McCarthy
    BrightWork 365 Solution Architect
    BrightWork
    Galway
    ------------------------------



  • 3.  RE: Issue with reciprocal lookup field for spouses - can't associate records due to parental relationship

    GOLD CONTRIBUTOR
    Posted 4 days ago
    Hey Donal, thank you for replicating the issue! Now I know I'm not crazy 🤪

    ------------------------------
    Lucas Hewitt
    Enterprise Application Specialist
    Ethnos360
    ------------------------------



  • 4.  RE: Issue with reciprocal lookup field for spouses - can't associate records due to parental relationship

    TOP CONTRIBUTOR
    Posted 4 days ago
    Hi Lucas.

    I recall running into this years ago.  If I recall, you should be able to set the relationships on the fields as referential or configurable cascading to get around this.  What you cannot have is a circular referential parental hierarchy.

    Give it a try and let me know if that fixes for you.​​

    ------------------------------
    Ryan Perry
    Business Systems Analyst
    The Helpful Bit
    ------------------------------



  • 5.  RE: Issue with reciprocal lookup field for spouses - can't associate records due to parental relationship

    GOLD CONTRIBUTOR
    Posted 4 days ago
    Thanks for the reply!

    The relationship is already set as Referential. I tried changing it to configurable cascading setting all the options to "cascade none" but it just reverts back to referential since I basically just recreated it.

    That's what's confusing me - it's acting Parental while set as Referential...

    ------------------------------
    Lucas Hewitt
    Enterprise Application Specialist
    Ethnos360
    ------------------------------



  • 6.  RE: Issue with reciprocal lookup field for spouses - can't associate records due to parental relationship

    TOP CONTRIBUTOR
    Posted 3 days ago
    Edited by Ryan Perry 3 days ago

    HI Lucas....

    I know this is definitely possible.  If I recall, the error is actually the result of a different relationship - one of the OOB fields - though I can't recall the specific one at the moment. To prove my point, as an example, if you create a custom entity, reciprocal relationships work fine.  I'll think on this and if I remember the workaround, will be sure to fill you in.


    Fore reference:
    https://docs.microsoft.com/en-us/previous-versions/dynamicscrm-2016/developers-guide/gg328297(v=crm.8)?redirectedfrom=MSDN#self-referencing-one-to-many-entity-relationships



    ------------------------------
    Ryan Perry
    Business Systems Analyst
    The Helpful Bit
    ------------------------------



  • 7.  RE: Issue with reciprocal lookup field for spouses - can't associate records due to parental relationship

    GOLD CONTRIBUTOR
    Posted yesterday
    Thanks Ryan! Here's hoping you can remember!

    ------------------------------
    Lucas Hewitt
    Enterprise Application Specialist
    Ethnos360
    ------------------------------



  • 8.  RE: Issue with reciprocal lookup field for spouses - can't associate records due to parental relationship

    Posted 12 hours ago
    Hello,
    Have you tried changing the relationship to N:N?  I know it may sound odd but essentially it seems like you are trying to associate a child to a parent and then a parent to a child as a parent even though that is not the type of relationship you selected.  It inherently assumes it is that way because of the N:1 association.  The other way around this would be to create a grid on the Spouse B record showing the Spouse A spouses but that seems silly to me.
    Good luck!

    ------------------------------
    Vanessa Lopez
    Black Knight Financial Services
    Jacksonville FL
    ------------------------------



  • 9.  RE: Issue with reciprocal lookup field for spouses - can't associate records due to parental relationship

    GOLD CONTRIBUTOR
    Posted 9 hours ago
    Hey Vanessa, thanks for the response!

    Stupid question - how do I set a lookup field to a N:N relationship? I know how to create the relationship itself but I can't figure out how to change the settings for the column itself.

    ------------------------------
    Lucas Hewitt
    Enterprise Application Specialist
    Ethnos360
    ------------------------------



  • 10.  RE: Issue with reciprocal lookup field for spouses - can't associate records due to parental relationship

    Posted 4 hours ago
    Hey there,
    Sorry but I was testing things out finally and was not able to associate the relationship after the fact.  I was hoping that would be an easy solution.  You probably need to just create a small sub grid view on the form and use that with a N:N relationship.  You will have to determine the best way to house the "parent" like a primary contact checkbox and then make the spouse the child.  You can also make it a show/hide so the grid only shows if the primary box is not selected but you can default it to true.
    Good Luck!

    ------------------------------
    Vanessa Lopez
    Black Knight Financial Services
    Jacksonville FL
    ------------------------------



  • 11.  RE: Issue with reciprocal lookup field for spouses - can't associate records due to parental relationship

    GOLD CONTRIBUTOR
    Posted an hour ago
    No worries! Thank you for testing that out for me!

    ------------------------------
    Lucas Hewitt
    Enterprise Application Specialist
    Ethnos360
    ------------------------------



If you've found this thread useful, dive deeper into User Group community content by role