locked
How to create a entity link in a custom entity? CRM 4 RRS feed

  • Question

  • I have looked on here and have found nothing yet.  I am making a new entity for keeping account information for our web system.  I want this new entity to be able to be associated with a contact.  How do I create a attribute (field) in CRM that will hold a object reference to a contact?

    Tuesday, June 17, 2008 5:49 PM

Answers

  • from your new entity create a N:1 relationship with Contact. This will create a contact lookup attribute in your custom entity that you can add to the form.

     

    Tuesday, June 17, 2008 6:41 PM
    Moderator
  • Hi.

     

    Basically this type of relationship does not exit in crm, but you can use existing features to achieve similar functionality.
    The easiest way is to create a 1(webconfig) : N (accounts) relationship and create a duplication rule on the account’s webconfig lookup.
    If an account with an existing “webconfig” does exist the user will be alerted.

     

    You can always extend your solution by filtering the account’s webconfig lookup to show specific webconfigs ( one’s with no account ) and Using a plug-in to enforce uniqueness on the other (webconfig) side.

     

    Hope this helps,

    Adi


     

    Tuesday, June 17, 2008 8:17 PM

All replies

  • from your new entity create a N:1 relationship with Contact. This will create a contact lookup attribute in your custom entity that you can add to the form.

     

    Tuesday, June 17, 2008 6:41 PM
    Moderator
  • Thanks.  What about a situation where:

     

    I have a custom entity I create.  It has two fields, Primary Contact and Decision Maker.  Both of these are links to a Contact.  Can I create 2 relationships like you said?

     

    Tuesday, June 17, 2008 6:45 PM
  • You do this by creating a relationship, which will create the attribute for you. You'll want a many-one relationship between your custom entity and the contact entity

     

    Tuesday, June 17, 2008 6:46 PM
    Moderator
  • I got it working.  Thank you very much.

     

    Tuesday, June 17, 2008 6:59 PM
  • I have one final question about relationships in CRM. 

     

    We need to extend the Account entity in order track our client's configuration settings on our website, but I don't want to modify the Account entity too much because of how much it is used in other areas of CRM.  So my solution is to create a new custom entity to hold the custom data. The new entity is called WebConfig.  WebConfig essentially has a one-to-one relationship with the Account entity.  After reading the above and doing some experimentation, I do not see a way to create one-to-one entity relationships.  Is this correct or am I missing something?

     

    Thanks again.

    Tuesday, June 17, 2008 7:07 PM
  • Hi.

     

    Basically this type of relationship does not exit in crm, but you can use existing features to achieve similar functionality.
    The easiest way is to create a 1(webconfig) : N (accounts) relationship and create a duplication rule on the account’s webconfig lookup.
    If an account with an existing “webconfig” does exist the user will be alerted.

     

    You can always extend your solution by filtering the account’s webconfig lookup to show specific webconfigs ( one’s with no account ) and Using a plug-in to enforce uniqueness on the other (webconfig) side.

     

    Hope this helps,

    Adi


     

    Tuesday, June 17, 2008 8:17 PM