{"id":15362,"date":"2019-04-10T12:01:54","date_gmt":"2019-04-10T12:01:54","guid":{"rendered":"https:\/\/www.inogic.com\/blog\/?p=15362"},"modified":"2021-12-06T14:55:38","modified_gmt":"2021-12-06T09:25:38","slug":"retrieval-of-many-to-many-nn-relationship-records-using-web-api-dynamics-365","status":"publish","type":"post","link":"https:\/\/www.inogic.com\/blog\/2019\/04\/retrieval-of-many-to-many-nn-relationship-records-using-web-api-dynamics-365\/","title":{"rendered":"Retrieval of Many-to-Many (N:N) Relationship Records using Web API in Dynamics 365"},"content":{"rendered":"<h2><strong>Introduction<\/strong><\/h2>\n<p>In this blog we will learn to retrieve Dynamic CRM entity records in respect of Many to Many relationships between two Dynamic CRM entities (OOB\/Custom).<\/p>\n<p>So let\u2019s take a look at the following example:<\/p>\n<p>In the below screeshot, there is one Many-to-Many relationship present between Account and Territory Entity of Dynamic CRM.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-15363\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/04\/1Web-API-in-Dynamics-365.png\" alt=\"Web API in Dynamics 365\" width=\"1366\" height=\"676\" style=\"border:1px solid #0a0a0a; padding:1px; margin:1px;\"\/><\/p>\n<p>One Territory entity subgrid is added to the Account entity form.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-15364\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/04\/2Web-API-in-Dynamics-365.png\" alt=\"Web API in Dynamics 365\" width=\"1351\" height=\"655\" style=\"border:1px solid #0a0a0a; padding:1px; margin:1px;\"\/><\/p>\n<p>So, now we need to retrieve Account entity records which are associated with the three territories shown in the above screenshot (i.e California, Nevada, New York). For this, we need to first prepare the fetchXml query for retrieving the Account entity records.<\/p>\n<p>&lt;fetch version=&#8221;1.0&#8243; output-format=&#8221;xml-platform&#8221; mapping=&#8221;logical&#8221; distinct=&#8221;true&#8221;&gt;<\/p>\n<p>&lt;entity name=&#8221;account&#8221;&gt;<\/p>\n<p>&lt;attribute name=&#8221;name&#8221; \/&gt;<\/p>\n<p>&lt;order attribute=&#8221;name&#8221; descending=&#8221;false&#8221; \/&gt;<\/p>\n<p>&lt;link-entity name=&#8221;new_account_territory_entity_name&#8221; from=&#8221;accountid&#8221; to=&#8221;accountid&#8221;\u00a0\u00a0\u00a0 visible=&#8221;false&#8221; intersect=&#8221;true&#8221;&gt;<\/p>\n<p>&lt;link-entity name=&#8221;territory&#8221; from=&#8221;territoryid&#8221; to=&#8221;territoryid&#8221; alias=&#8221;ab&#8221;&gt;<\/p>\n<p>&lt;filter type=&#8221;and&#8221;&gt;<\/p>\n<p>&lt;filter type=&#8221;or&#8221;&gt;<\/p>\n<p>&lt;condition attribute=&#8221;name&#8221; operator=&#8221;eq&#8221; value=&#8221;Nevada&#8221; \/&gt;<\/p>\n<p>&lt;condition attribute=&#8221;name&#8221; operator=&#8221;eq&#8221; value=&#8221;New York&#8221; \/&gt;<\/p>\n<p>&lt;\/filter&gt;<\/p>\n<p>&lt;\/filter&gt;<\/p>\n<p>&lt;attribute name=&#8221;name&#8221; \/&gt;<\/p>\n<p>&lt;attribute name=&#8221;territoryid&#8221; \/&gt;<\/p>\n<p>&lt;\/link-entity&gt;<\/p>\n<p>&lt;\/link-entity&gt;<\/p>\n<p>&lt;\/entity&gt;<\/p>\n<p>&lt;\/fetch&gt;<\/p>\n<p>&nbsp;<\/p>\n<blockquote><p><strong>Note:<\/strong><\/p>\n<p><strong>new_account_territory_entity_name: It is defined as IntersectEntityName which you can get from N:N relationship record as shown in the screenshot below.<\/strong><\/p>\n<p><strong>accountid:\u00a0 It is defined as Entity1IntersectAttribute attribute which you can get from N:N relationship record.<\/strong><\/p><\/blockquote>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-15365\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/04\/3Web-API-in-Dynamics-365.png\" alt=\"Web API in Dynamics 365\" width=\"1366\" height=\"675\" style=\"border:1px solid #0a0a0a; padding:1px; margin:1px;\"\/><\/p>\n<p>Now run this fetchXml query using Web API.<\/p>\n<p>\/\/create AJAX request<\/p>\n<p>Maplytics_jQ.ajax({<\/p>\n<p>type: &#8220;GET&#8221;,<\/p>\n<p>contentType: &#8220;application\/json; charset=utf-8&#8221;,<\/p>\n<p>datatype: &#8220;json&#8221;,<\/p>\n<p>\/\/async: false,<\/p>\n<p>url: this.getWebAPIPath() + entitySetName + &#8220;?fetchXml=&#8221; + fetchXml,<\/p>\n<p>beforeSend: function (xhr) {<\/p>\n<p>\/\/Specifying this header ensures that the results will be returned as JSON.<\/p>\n<p>xhr.setRequestHeader(&#8220;Accept&#8221;, &#8220;application\/json&#8221;);<\/p>\n<p>xhr.setRequestHeader(&#8220;Content-Type&#8221;, &#8220;application\/json; odata.metadata=minimal&#8221;);<\/p>\n<p>xhr.setRequestHeader(&#8220;OData-MaxVersion&#8221;, &#8220;4.0&#8221;);<\/p>\n<p>xhr.setRequestHeader(&#8220;OData-Version&#8221;, &#8220;4.0&#8221;);<\/p>\n<p>xhr.setRequestHeader(&#8220;Prefer&#8221;, &#8220;odata.include-annotations=*&#8221;);<\/p>\n<p>},<\/p>\n<p>success: function (data, textStatus, xhr) {<\/p>\n<p>&nbsp;<\/p>\n<p>},<\/p>\n<p>error: function (xhr, textStatus, errorThrown) {<\/p>\n<p>retrieveUsingFetchError(Inogic.Maplytics.ApiLib.errorHandler(xhr));<\/p>\n<p>}<\/p>\n<p>});<\/p>\n<h2><strong>Conclusion<\/strong><\/h2>\n<p>The above query will help to retrieve Account records which are associated with three territories records (i.e Nevada, New York, California).<\/p>\n<h2 style=\"text-align: left;\"><div class=\"su-heading su-heading-style-default su-heading-align-center\" id=\"\" style=\"font-size:15px;margin-bottom:5px\"><div class=\"su-heading-inner\">One Pic = 1000 words! Analyze data 90% faster with visualization apps!<\/div><\/div><\/h2>\n<p style=\"text-align: left;\"><em>Get optimum visualization of Dynamics 365 CRM data with &#8211;<\/em><br \/>\n<em><strong><a href=\"https:\/\/bit.ly\/3lYvozZ\" target=\"_blank\" rel=\"noopener noreferrer\">Kanban Board<\/a> <\/strong>\u2013 Visualize Dynamics 365 CRM data in Kanban view by categorizing entity records in lanes and rows as per their status, priority, etc.<\/em><br \/>\n<em><strong><a href=\"https:\/\/bit.ly\/3lCSBaA\" target=\"_blank\" rel=\"noopener noreferrer\">Map My Relationships<\/a><\/strong> \u2013 Map My Relationships \u2013 Visualize connections and relationships between Dynamics 365 CRM entities or related records in a Mind Map view.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction In this blog we will learn to retrieve Dynamic CRM entity records in respect of Many to Many relationships between two Dynamic CRM entities (OOB\/Custom). So let\u2019s take a look at the following example: In the below screeshot, there is one Many-to-Many relationship present between Account and Territory Entity of Dynamic CRM. One Territory\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.inogic.com\/blog\/2019\/04\/retrieval-of-many-to-many-nn-relationship-records-using-web-api-dynamics-365\/\">Read More: Retrieval of Many-to-Many (N:N) Relationship Records using Web API in\u2026 &raquo;<\/a><\/span><\/p>\n","protected":false},"author":13,"featured_media":15366,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18,19,65],"tags":[1823],"class_list":["post-15362","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dynamics-365-v9-2","category-dynamics-crm","category-webapi","tag-web-api-in-dynamics-365"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.8 - aioseo.com -->\n\t<meta name=\"description\" content=\"Introduction In this blog we will learn to retrieve Dynamic CRM entity records in respect of Many to Many relationships between two Dynamic CRM entities (OOB\/Custom). So let\u2019s take a look at the following example: In the below screeshot, there is one Many-to-Many relationship present between Account and Territory Entity of Dynamic CRM. One Territory\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Tushar\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.inogic.com\/blog\/2019\/04\/retrieval-of-many-to-many-nn-relationship-records-using-web-api-dynamics-365\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.8\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Microsoft Dynamics 365 CRM Tips and Tricks - By Inogic\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Retrieval of Many-to-Many (N:N) Relationship Records using Web API in Dynamics 365 - Microsoft Dynamics 365 CRM Tips and Tricks\" \/>\n\t\t<meta property=\"og:description\" content=\"Introduction In this blog we will learn to retrieve Dynamic CRM entity records in respect of Many to Many relationships between two Dynamic CRM entities (OOB\/Custom). So let\u2019s take a look at the following example: In the below screeshot, there is one Many-to-Many relationship present between Account and Territory Entity of Dynamic CRM. One Territory\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.inogic.com\/blog\/2019\/04\/retrieval-of-many-to-many-nn-relationship-records-using-web-api-dynamics-365\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/04\/1Web-API-in-Dynamics-365.png\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/04\/1Web-API-in-Dynamics-365.png\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2019-04-10T12:01:54+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2021-12-06T09:25:38+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/inogicindia\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:site\" content=\"@inogic\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Retrieval of Many-to-Many (N:N) Relationship Records using Web API in Dynamics 365 - Microsoft Dynamics 365 CRM Tips and Tricks\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Introduction In this blog we will learn to retrieve Dynamic CRM entity records in respect of Many to Many relationships between two Dynamic CRM entities (OOB\/Custom). So let\u2019s take a look at the following example: In the below screeshot, there is one Many-to-Many relationship present between Account and Territory Entity of Dynamic CRM. One Territory\" \/>\n\t\t<meta name=\"twitter:creator\" content=\"@inogic\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/04\/1Web-API-in-Dynamics-365.png\" \/>\n\t\t<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t\t<meta name=\"twitter:data1\" content=\"Tushar\" \/>\n\t\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BlogPosting\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2019\\\/04\\\/retrieval-of-many-to-many-nn-relationship-records-using-web-api-dynamics-365\\\/#blogposting\",\"name\":\"Retrieval of Many-to-Many (N:N) Relationship Records using Web API in Dynamics 365 - Microsoft Dynamics 365 CRM Tips and Tricks\",\"headline\":\"Retrieval of Many-to-Many (N:N) Relationship Records using Web API in Dynamics 365\",\"author\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/author\\\/inogic-2\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/04\\\/Retrieve-ManyTomany-related-records-in-Dynamics-365-using-Web-API-1.png\",\"width\":150,\"height\":140,\"caption\":\"Retrieve ManyTomany related records in Dynamics 365 using Web API\"},\"datePublished\":\"2019-04-10T12:01:54+05:30\",\"dateModified\":\"2021-12-06T14:55:38+05:30\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2019\\\/04\\\/retrieval-of-many-to-many-nn-relationship-records-using-web-api-dynamics-365\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2019\\\/04\\\/retrieval-of-many-to-many-nn-relationship-records-using-web-api-dynamics-365\\\/#webpage\"},\"articleSection\":\"Dynamics 365 v9, Dynamics CRM, WEB API, Web API in Dynamics 365\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2019\\\/04\\\/retrieval-of-many-to-many-nn-relationship-records-using-web-api-dynamics-365\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.inogic.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/category\\\/dynamics-365-v9-2\\\/#listItem\",\"name\":\"Dynamics 365 v9\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/category\\\/dynamics-365-v9-2\\\/#listItem\",\"position\":2,\"name\":\"Dynamics 365 v9\",\"item\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/category\\\/dynamics-365-v9-2\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2019\\\/04\\\/retrieval-of-many-to-many-nn-relationship-records-using-web-api-dynamics-365\\\/#listItem\",\"name\":\"Retrieval of Many-to-Many (N:N) Relationship Records using Web API in Dynamics 365\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2019\\\/04\\\/retrieval-of-many-to-many-nn-relationship-records-using-web-api-dynamics-365\\\/#listItem\",\"position\":3,\"name\":\"Retrieval of Many-to-Many (N:N) Relationship Records using Web API in Dynamics 365\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/category\\\/dynamics-365-v9-2\\\/#listItem\",\"name\":\"Dynamics 365 v9\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/#organization\",\"name\":\"Microsoft Dynamics 365 CRM Tips and Tricks\",\"description\":\"By Inogic\",\"url\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/02\\\/inogic-logo.png\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2019\\\/04\\\/retrieval-of-many-to-many-nn-relationship-records-using-web-api-dynamics-365\\\/#organizationLogo\",\"width\":1000,\"height\":325,\"caption\":\"inogic logo\"},\"image\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2019\\\/04\\\/retrieval-of-many-to-many-nn-relationship-records-using-web-api-dynamics-365\\\/#organizationLogo\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/inogicindia\",\"https:\\\/\\\/twitter.com\\\/inogic\",\"https:\\\/\\\/www.instagram.com\\\/inogicindia\\\/\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCM4V7ousgLSu1hbOEv4DUuQ\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/inogicindia\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/author\\\/inogic-2\\\/#author\",\"url\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/author\\\/inogic-2\\\/\",\"name\":\"Tushar\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2019\\\/04\\\/retrieval-of-many-to-many-nn-relationship-records-using-web-api-dynamics-365\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/839d9ae7d2b941d2d09e91df322267a429821f2ce5494302b53bd5ca3679f1a0?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Tushar\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2019\\\/04\\\/retrieval-of-many-to-many-nn-relationship-records-using-web-api-dynamics-365\\\/#webpage\",\"url\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2019\\\/04\\\/retrieval-of-many-to-many-nn-relationship-records-using-web-api-dynamics-365\\\/\",\"name\":\"Retrieval of Many-to-Many (N:N) Relationship Records using Web API in Dynamics 365 - Microsoft Dynamics 365 CRM Tips and Tricks\",\"description\":\"Introduction In this blog we will learn to retrieve Dynamic CRM entity records in respect of Many to Many relationships between two Dynamic CRM entities (OOB\\\/Custom). So let\\u2019s take a look at the following example: In the below screeshot, there is one Many-to-Many relationship present between Account and Territory Entity of Dynamic CRM. One Territory\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2019\\\/04\\\/retrieval-of-many-to-many-nn-relationship-records-using-web-api-dynamics-365\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/author\\\/inogic-2\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/author\\\/inogic-2\\\/#author\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/04\\\/Retrieve-ManyTomany-related-records-in-Dynamics-365-using-Web-API-1.png\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2019\\\/04\\\/retrieval-of-many-to-many-nn-relationship-records-using-web-api-dynamics-365\\\/#mainImage\",\"width\":150,\"height\":140,\"caption\":\"Retrieve ManyTomany related records in Dynamics 365 using Web API\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2019\\\/04\\\/retrieval-of-many-to-many-nn-relationship-records-using-web-api-dynamics-365\\\/#mainImage\"},\"datePublished\":\"2019-04-10T12:01:54+05:30\",\"dateModified\":\"2021-12-06T14:55:38+05:30\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/\",\"name\":\"Microsoft Dynamics 365 CRM Tips and Tricks\",\"alternateName\":\"Inogic\",\"description\":\"By Inogic\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Retrieval of Many-to-Many (N:N) Relationship Records using Web API in Dynamics 365 - Microsoft Dynamics 365 CRM Tips and Tricks","description":"Introduction In this blog we will learn to retrieve Dynamic CRM entity records in respect of Many to Many relationships between two Dynamic CRM entities (OOB\/Custom). So let\u2019s take a look at the following example: In the below screeshot, there is one Many-to-Many relationship present between Account and Territory Entity of Dynamic CRM. One Territory","canonical_url":"https:\/\/www.inogic.com\/blog\/2019\/04\/retrieval-of-many-to-many-nn-relationship-records-using-web-api-dynamics-365\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BlogPosting","@id":"https:\/\/www.inogic.com\/blog\/2019\/04\/retrieval-of-many-to-many-nn-relationship-records-using-web-api-dynamics-365\/#blogposting","name":"Retrieval of Many-to-Many (N:N) Relationship Records using Web API in Dynamics 365 - Microsoft Dynamics 365 CRM Tips and Tricks","headline":"Retrieval of Many-to-Many (N:N) Relationship Records using Web API in Dynamics 365","author":{"@id":"https:\/\/www.inogic.com\/blog\/author\/inogic-2\/#author"},"publisher":{"@id":"https:\/\/www.inogic.com\/blog\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/04\/Retrieve-ManyTomany-related-records-in-Dynamics-365-using-Web-API-1.png","width":150,"height":140,"caption":"Retrieve ManyTomany related records in Dynamics 365 using Web API"},"datePublished":"2019-04-10T12:01:54+05:30","dateModified":"2021-12-06T14:55:38+05:30","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/www.inogic.com\/blog\/2019\/04\/retrieval-of-many-to-many-nn-relationship-records-using-web-api-dynamics-365\/#webpage"},"isPartOf":{"@id":"https:\/\/www.inogic.com\/blog\/2019\/04\/retrieval-of-many-to-many-nn-relationship-records-using-web-api-dynamics-365\/#webpage"},"articleSection":"Dynamics 365 v9, Dynamics CRM, WEB API, Web API in Dynamics 365"},{"@type":"BreadcrumbList","@id":"https:\/\/www.inogic.com\/blog\/2019\/04\/retrieval-of-many-to-many-nn-relationship-records-using-web-api-dynamics-365\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog#listItem","position":1,"name":"Home","item":"https:\/\/www.inogic.com\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog\/category\/dynamics-365-v9-2\/#listItem","name":"Dynamics 365 v9"}},{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog\/category\/dynamics-365-v9-2\/#listItem","position":2,"name":"Dynamics 365 v9","item":"https:\/\/www.inogic.com\/blog\/category\/dynamics-365-v9-2\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog\/2019\/04\/retrieval-of-many-to-many-nn-relationship-records-using-web-api-dynamics-365\/#listItem","name":"Retrieval of Many-to-Many (N:N) Relationship Records using Web API in Dynamics 365"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog\/2019\/04\/retrieval-of-many-to-many-nn-relationship-records-using-web-api-dynamics-365\/#listItem","position":3,"name":"Retrieval of Many-to-Many (N:N) Relationship Records using Web API in Dynamics 365","previousItem":{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog\/category\/dynamics-365-v9-2\/#listItem","name":"Dynamics 365 v9"}}]},{"@type":"Organization","@id":"https:\/\/www.inogic.com\/blog\/#organization","name":"Microsoft Dynamics 365 CRM Tips and Tricks","description":"By Inogic","url":"https:\/\/www.inogic.com\/blog\/","logo":{"@type":"ImageObject","url":"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2023\/02\/inogic-logo.png","@id":"https:\/\/www.inogic.com\/blog\/2019\/04\/retrieval-of-many-to-many-nn-relationship-records-using-web-api-dynamics-365\/#organizationLogo","width":1000,"height":325,"caption":"inogic logo"},"image":{"@id":"https:\/\/www.inogic.com\/blog\/2019\/04\/retrieval-of-many-to-many-nn-relationship-records-using-web-api-dynamics-365\/#organizationLogo"},"sameAs":["https:\/\/www.facebook.com\/inogicindia","https:\/\/twitter.com\/inogic","https:\/\/www.instagram.com\/inogicindia\/","https:\/\/www.youtube.com\/channel\/UCM4V7ousgLSu1hbOEv4DUuQ","https:\/\/www.linkedin.com\/company\/inogicindia"]},{"@type":"Person","@id":"https:\/\/www.inogic.com\/blog\/author\/inogic-2\/#author","url":"https:\/\/www.inogic.com\/blog\/author\/inogic-2\/","name":"Tushar","image":{"@type":"ImageObject","@id":"https:\/\/www.inogic.com\/blog\/2019\/04\/retrieval-of-many-to-many-nn-relationship-records-using-web-api-dynamics-365\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/839d9ae7d2b941d2d09e91df322267a429821f2ce5494302b53bd5ca3679f1a0?s=96&d=mm&r=g","width":96,"height":96,"caption":"Tushar"}},{"@type":"WebPage","@id":"https:\/\/www.inogic.com\/blog\/2019\/04\/retrieval-of-many-to-many-nn-relationship-records-using-web-api-dynamics-365\/#webpage","url":"https:\/\/www.inogic.com\/blog\/2019\/04\/retrieval-of-many-to-many-nn-relationship-records-using-web-api-dynamics-365\/","name":"Retrieval of Many-to-Many (N:N) Relationship Records using Web API in Dynamics 365 - Microsoft Dynamics 365 CRM Tips and Tricks","description":"Introduction In this blog we will learn to retrieve Dynamic CRM entity records in respect of Many to Many relationships between two Dynamic CRM entities (OOB\/Custom). So let\u2019s take a look at the following example: In the below screeshot, there is one Many-to-Many relationship present between Account and Territory Entity of Dynamic CRM. One Territory","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.inogic.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/www.inogic.com\/blog\/2019\/04\/retrieval-of-many-to-many-nn-relationship-records-using-web-api-dynamics-365\/#breadcrumblist"},"author":{"@id":"https:\/\/www.inogic.com\/blog\/author\/inogic-2\/#author"},"creator":{"@id":"https:\/\/www.inogic.com\/blog\/author\/inogic-2\/#author"},"image":{"@type":"ImageObject","url":"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/04\/Retrieve-ManyTomany-related-records-in-Dynamics-365-using-Web-API-1.png","@id":"https:\/\/www.inogic.com\/blog\/2019\/04\/retrieval-of-many-to-many-nn-relationship-records-using-web-api-dynamics-365\/#mainImage","width":150,"height":140,"caption":"Retrieve ManyTomany related records in Dynamics 365 using Web API"},"primaryImageOfPage":{"@id":"https:\/\/www.inogic.com\/blog\/2019\/04\/retrieval-of-many-to-many-nn-relationship-records-using-web-api-dynamics-365\/#mainImage"},"datePublished":"2019-04-10T12:01:54+05:30","dateModified":"2021-12-06T14:55:38+05:30"},{"@type":"WebSite","@id":"https:\/\/www.inogic.com\/blog\/#website","url":"https:\/\/www.inogic.com\/blog\/","name":"Microsoft Dynamics 365 CRM Tips and Tricks","alternateName":"Inogic","description":"By Inogic","inLanguage":"en-US","publisher":{"@id":"https:\/\/www.inogic.com\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"Microsoft Dynamics 365 CRM Tips and Tricks - By Inogic","og:type":"article","og:title":"Retrieval of Many-to-Many (N:N) Relationship Records using Web API in Dynamics 365 - Microsoft Dynamics 365 CRM Tips and Tricks","og:description":"Introduction In this blog we will learn to retrieve Dynamic CRM entity records in respect of Many to Many relationships between two Dynamic CRM entities (OOB\/Custom). So let\u2019s take a look at the following example: In the below screeshot, there is one Many-to-Many relationship present between Account and Territory Entity of Dynamic CRM. One Territory","og:url":"https:\/\/www.inogic.com\/blog\/2019\/04\/retrieval-of-many-to-many-nn-relationship-records-using-web-api-dynamics-365\/","og:image":"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/04\/1Web-API-in-Dynamics-365.png","og:image:secure_url":"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/04\/1Web-API-in-Dynamics-365.png","article:published_time":"2019-04-10T12:01:54+00:00","article:modified_time":"2021-12-06T09:25:38+00:00","article:publisher":"https:\/\/www.facebook.com\/inogicindia","twitter:card":"summary_large_image","twitter:site":"@inogic","twitter:title":"Retrieval of Many-to-Many (N:N) Relationship Records using Web API in Dynamics 365 - Microsoft Dynamics 365 CRM Tips and Tricks","twitter:description":"Introduction In this blog we will learn to retrieve Dynamic CRM entity records in respect of Many to Many relationships between two Dynamic CRM entities (OOB\/Custom). So let\u2019s take a look at the following example: In the below screeshot, there is one Many-to-Many relationship present between Account and Territory Entity of Dynamic CRM. One Territory","twitter:creator":"@inogic","twitter:image":"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/04\/1Web-API-in-Dynamics-365.png","twitter:label1":"Written by","twitter:data1":"Tushar","twitter:label2":"Est. reading time","twitter:data2":"2 minutes"},"aioseo_meta_data":{"post_id":"15362","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2023-02-02 07:08:01","updated":"2025-07-04 06:00:03","seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.inogic.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.inogic.com\/blog\/category\/dynamics-365-v9-2\/\" title=\"Dynamics 365 v9\">Dynamics 365 v9<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tRetrieval of Many-to-Many (N:N) Relationship Records using Web API in Dynamics 365\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.inogic.com\/blog"},{"label":"Dynamics 365 v9","link":"https:\/\/www.inogic.com\/blog\/category\/dynamics-365-v9-2\/"},{"label":"Retrieval of Many-to-Many (N:N) Relationship Records using Web API in Dynamics 365","link":"https:\/\/www.inogic.com\/blog\/2019\/04\/retrieval-of-many-to-many-nn-relationship-records-using-web-api-dynamics-365\/"}],"_links":{"self":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/15362","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/comments?post=15362"}],"version-history":[{"count":0,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/15362\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media\/15366"}],"wp:attachment":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media?parent=15362"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/categories?post=15362"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/tags?post=15362"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}