Answered by:
Custom entity related to customer (Account or Contact)

Question
-
How is it possible to relate a custom entity to either an Account or Contact record using the same attribute...
There is an out of the box entity named 'Customer Relationship' which has this functionality, also Opportunity has the same feature.
How can we emulate this using our own custom entities? I have tried hacking the xml directly but unfortunately on import, CRM tries to recreate the attribute rather that reusing it, and it complains that it already exists...
ThanksTuesday, February 16, 2010 11:54 PM
Answers
-
Hi Ashwood,
Unfortunately there is no supported way to create a relationship to a customer (account or contact combined). The only workarounds for your custom entities is to create both a relationship to an account and a contact. You can then use javascript to display one or another.
Alex Fagundes - www.PowerObjects.com- Proposed as answer by Alex Fagundes - PowerObjects Wednesday, February 17, 2010 4:28 AM
- Marked as answer by Josh Ashwood Wednesday, February 17, 2010 9:34 PM
Wednesday, February 17, 2010 4:28 AM
All replies
-
Hi Ashwood,
Unfortunately there is no supported way to create a relationship to a customer (account or contact combined). The only workarounds for your custom entities is to create both a relationship to an account and a contact. You can then use javascript to display one or another.
Alex Fagundes - www.PowerObjects.com- Proposed as answer by Alex Fagundes - PowerObjects Wednesday, February 17, 2010 4:28 AM
- Marked as answer by Josh Ashwood Wednesday, February 17, 2010 9:34 PM
Wednesday, February 17, 2010 4:28 AM -
Hi Ashwook,
When you create a relationship between, for example a custom entity and Account. You will type in a name for the attribute holding the id (guid) between the two entities. This attribute is placed on both entities, and is creating the relationship. That way you have a shared attribute.
Henrik Jensen Instructor / Consultant MCP, MCAD, MCSD, MCTS, MCPD, MCITP, MBSS, MBSP, MCT www.crmblog.dk (Danish only)- Proposed as answer by Henrik Jensen - CRMBlog.dk Wednesday, February 17, 2010 7:25 AM
- Marked as answer by Jim Glass Jr Wednesday, February 17, 2010 7:08 PM
- Unmarked as answer by Josh Ashwood Wednesday, February 17, 2010 9:34 PM
Wednesday, February 17, 2010 7:25 AM -
Hi Henrik
Thanks for your reply - I'm aware how to create standard relationships between entities - I was wondering whether it was possible to create a relationship to both Account and Contact using the same attribute, like happens on the Opportunity record - so the one attribute can store a reference to either an Account record or a Contact record.
Unfortunately it doesn't seem possible - if there is already a relationship between custom Entity A for example, and Contact, and I create another relationship from custom entity A to Account, a new attribute is created for the relationship between entity A and Account.
Modify the customizations xml for the custom entity and attempting to create another relationship to another entity using an attribute already used for an existing relationship fails also - CRM attempts to recreate the attribute, and I get an error saying the attribute already exists.Wednesday, February 17, 2010 9:41 PM