CRM Entity Relationship Many to Many (N:N)

There are two ways of getting the related entity details in many to many relationship in CRM 4.0

One way is to use RetrieveMultipleRequest function from the SDK:



For example, if we have a Loan custom entity and we want to return sets of borrowers (contacts):



---
Second way is to use Fetch function to return the XML of the related entities:


James Downey created a nice little program FetchXMLBuilder to help you build the fetch query.

---
Just for completion, below is the CRMServiceWrapper constructor that I use:



Hope this helps ^_^

Comments

  1. hy Andreas,
    i'm trying to insert a record in entity with many to many relationship. how do i do that??

    i'm using crmservice.create method.
    any ideas??

    thanks

    ReplyDelete
    Replies
    1. Hi, you should use AssociateRequest to establish the relationship. Example is in this blog:

      http://chaitanyaprasadtk.blogspot.com.au/2012/01/dealing-with-nn-relationship-in-crm.html

      Delete

Post a Comment

Popular posts from this blog

SharePoint 2013 anonymous access add attachments to list item

CRM Plugin - Parent and Child Pipeline

Sitecore custom publish agent from specific node and at a specific time