locked
1:1 Relationships by altering lookup RRS feed

  • Question

  •  

    Hi,

     

    Is it possible to force a 1:1 relationship by customising a lookup field generated for a N:1 relationship?

     

    I have a custom entity called property data which holds data extra data for some types of accounts, i would like just one poperty data entry per account and am struggling to get my head around how i might achieve this.

     

    Does anyone have any suggestions of how i might do this?

     

    Any help appreciated

     

    Thanks and Regards

     

    Tim

    Wednesday, January 14, 2009 1:31 PM

Answers

All replies

  • Tim,

     

    Why do you need to hold this data in an extra entity?

     

    For optional 1:1 data on a project I worked on we simply used a radio button to indicate its state and then showed/hid a tab on the form that contained this info. All the info is held on the Account entity.

     

    In views related to this we then simply queried the status of this radio button.

     

    Creating a seperate entity to hold 1:1 data seems like a large overhead unless I have misunderstood what it is you are trying to do?

     

    Ron.

     

    Wednesday, January 14, 2009 2:23 PM
  • Tim

     

    I take it you want to have the sort of scenario where you would choose a Property Data entry in your Account entity and then for that Property Data entry not to be available to any other Account unless it was freed up by it's associated Account?  If that is the case then you would have to do something that would search through all other Accounts to see if that Property Data was associated with another Account.  You might be able to do that kind of validation using JavaScript or AJAX (sorry I have never used AJAX but from what I do know of it, it might be the thing to use).

     

    Sorry I can't be any more help than that.

     

    Cheers,

     

    Dougy

     

    Wednesday, January 14, 2009 2:28 PM
  • Yes.

     

    Likely what you'll want to do is NOT show the relationship on the other side because that's where the multiple would manifest.  Look at the primary contact to account relationship -- you have the 1 on the account side in a lookup but nothing on the contact form about it.  I.e. you don't want it on the details pane as some sort of I'm-the-primary-contact-to-these-accounts list.

     

    A side note:

    You CANNOT do this with activities, e.g. the appointment that yielded the order because you can't add a 1-to-N to an activity (or N-to-1, which ever is the one that is the solution in other cases.)  Orders can have plenty of appointments but not a "primary" appointment.

     

    Wednesday, January 14, 2009 9:28 PM
  • Hi guys,

     

    A similar scenario was discussed by us some time ago in that post: http://forums.microsoft.com/Dynamics/ShowPost.aspx?PostID=4231640&SiteID=27. Take a look at it, becuse it may happen to be useful. Adi Katz proposes a solution for customizing the interface to pretend having 1:1 relationships...

     

    Regards,

    Kuba

     

    Wednesday, January 14, 2009 11:38 PM