Search code examples
c#.netentitymicrosoft-dynamicsdynamics-crm-2015

Is it posible to create a virtual entity in MS Dynamics CRM 2015?


the customer entity in MS Dynamics CRM is not a "normal" entity. It is a virtual composite entity. The question is... Is it posible to create a own virtual entity? And if so how?

I want to create different contract entities and it would be nice to have just the contractid which can be one of a bunch of different contractids. So if there exists a xcontract entity and a ycontract entity and a field where I can insert a contractid it is possible to insert a xcontractid or a ycontractid. Just like it is solved with the customerid and the accountid/contactid.

Thanks.


Solution

  • I can think of two options that may be able to resolve what you're asking. I'll make a base assumption first, based on your question to help confine my answer.

    Assumption: You desire Entity A to have a single relationship to either Entity B or Entity C

    Option 1 - Custom Joining Entity

    Not sure if this achieves the end result you are looking for, but you could Create Entity D, that has an Entity B and Entity C field, and then create a relationship from Entity A to Entity D. Entity D would be your "Customer" and Entity B & C would be your account and contact respectively. You'd have to write a few plugins to ensure the relationship is accurate, and to properly update the display name of Entity D, when it changes for the related Entity B or C records.

    Option 2 - Activity Party

    Assuming Entities B & C have yet to be created, create them as Custom Activities. You can then select them from an activity party list in the client. You could also add pre-filters that constrain the activity types that are being queried when the user attempts to lookup an existing record.