locked
One-to-One (1:1) relationship in CRM 2011 RRS feed

  • Question

  • How does one create a one-to-one relationship (1:1) in CRM 2011?  Thanks!
    Tuesday, April 3, 2012 3:00 PM

Answers

  • Sadly, there still is no 1:1 relationship in CRM.  We have done the following (as the closest approximation):

    1. Set 1:N relationships from each affected entity to the other
    2. Hide the 'many'-side nav items in each entity's form left nav.
    3. Write a plugin that will run on the lookup value update from each entity to the other.  This plugin checks if there is a value on the single side of the other entity.  If not, it updates the lookup field on that entity with the current entity id.  If one exists, it could either reject the update or replace the other entity's lookup value with the current entity id (being careful to check for circular logic of course).

    • Marked as answer by wikky2007 Thursday, April 12, 2012 6:49 PM
    Tuesday, April 3, 2012 7:50 PM

All replies

  • hmm.. If you need a 1:1 relationship... Why not simply create them as custom attributes on the base entity. Any specific reason to move this to another entity...

    Sam


    Dynamics CRM MVP | Inogic | http://inogic.blogspot.com| news at inogic dot com

    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

    Tuesday, April 3, 2012 4:18 PM
  • Sadly, there still is no 1:1 relationship in CRM.  We have done the following (as the closest approximation):

    1. Set 1:N relationships from each affected entity to the other
    2. Hide the 'many'-side nav items in each entity's form left nav.
    3. Write a plugin that will run on the lookup value update from each entity to the other.  This plugin checks if there is a value on the single side of the other entity.  If not, it updates the lookup field on that entity with the current entity id.  If one exists, it could either reject the update or replace the other entity's lookup value with the current entity id (being careful to check for circular logic of course).

    • Marked as answer by wikky2007 Thursday, April 12, 2012 6:49 PM
    Tuesday, April 3, 2012 7:50 PM
  • Perhaps as in my case, a zero to 1 is relationship was needed and you don't want each instance of the base entity to define the fields. I also would like to know what is the best way to show fields from the base entity on the related entity. The form editor doesn't allow the related entities to be picked for display on the form.
    Thursday, April 11, 2013 8:31 PM