{"id":12519,"date":"2018-07-27T15:34:11","date_gmt":"2018-07-27T10:04:11","guid":{"rendered":"https:\/\/www.inogic.com\/blog\/?p=12519"},"modified":"2018-07-27T15:34:11","modified_gmt":"2018-07-27T10:04:11","slug":"use-web-api-batch-request-in-dynamics-365-to-execute-long-fetchxml","status":"publish","type":"post","link":"https:\/\/www.inogic.com\/blog\/2018\/07\/use-web-api-batch-request-in-dynamics-365-to-execute-long-fetchxml\/","title":{"rendered":"Use WEB API Batch Request in Dynamics 365 to execute long FetchXML"},"content":{"rendered":"<h2><strong>Introduction:<\/strong><\/h2>\n<p style=\"text-align: justify;\">Recently we had a project where we use WEB API for retrieve the records from Dynamics CRM. In our project, we dynamically create FetchXML to retrieve records but sometimes Fetchxml have a lot of columns and conditions etc so its length get increase and we this the fetchxml in URL which violates the browser URL length rule. So When we try to execute this long length FetchXML and retrieve the records using the GET method, We were getting the error message of \u201cHTTP Error 404 &#8211; Not Found\u201d because of WEB API request fails to execute too long FetchXML. When we work on this error message, we find that we need to use WEB API Batch Request to execute the long FetchXML.<\/p>\n<p style=\"text-align: justify;\">In the below example, we execute the long FetchXML of account entity and use POST request to execute long FetchXML.<\/p>\n<p style=\"text-align: justify;\">First, we created the simple request body as below:<\/p>\n<pre class=\"lang:default decode:true\">\/\/create request body\nvar bodyFetch='';\nbodyFetch = '--batch_recordfetch\\n'\nbodyFetch += 'Content-Type: application\/http\\n'\nbodyFetch += 'Content-Transfer-Encoding: binary\\n'\nbodyFetch += '\\n'\nbodyFetch += 'GET [CRM URL]\/api\/data\/v8.2\/accounts?fetchXml=' + fetch + ' HTTP\/1.1\\n'\nbodyFetch += 'Content-Type: application\/json\\n'\nbodyFetch += 'OData-Version: 4.0\\n'\nbodyFetch += 'OData-MaxVersion: 4.0\\n'\nbodyFetch += 'Prefer: odata.include-annotations=*\\n'\nbodyFetch += '\\n'\nbodyFetch += '--batch_recordfetch--'<\/pre>\n<blockquote><p>Note: \u2018fetch\u2019 is the parameter of the long FetchXML.<\/p><\/blockquote>\n<p>And we pass the created the simple request body as data to Ajax request and we will receive the response of request as success or failure as below:<\/p>\n<pre class=\"lang:default decode:true\">\/\/create AJAX request\n$.ajax({\ntype: \"POST\",\ncontentType: \"application\/json; charset=utf-8\",\ndatatype: \"json\",\nasync: true,\nurl: '[CRM URL]\/api\/data\/v8.2\/' + '$batch',\ndata: bodyFetch,\nbeforeSend: function (xhr) {\n\/\/Specifying this header ensures that the results will be returned as JSON.\nxhr.setRequestHeader(\"Accept\", \"application\/json\");\nxhr.setRequestHeader(\"OData-MaxVersion\", \"4.0\");\nxhr.setRequestHeader(\"OData-Version\", \"4.0\");\nxhr.setRequestHeader(\"Prefer\", \"odata.include-annotations=*\");\nxhr.setRequestHeader(\"Content-Type\", \"multipart\/mixed;boundary=batch_recordfetch\");\n},\n\/\/success callback\nsuccess: function (data, textStatus, xhr) {\ndata = JSON.parse(data.substring(data.indexOf('{'), data.lastIndexOf('}') + 1));\nif (data != null) {\nif (data.value == null) {\nalert(\"success\");\n}\n}\n},\n\/\/error callback\nerror: function (xhr, textStatus, errorThrown) {\nalert(\"failed\");                          \n}\n});<\/pre>\n<h2>Conclusion:<\/h2>\n<p>User can easily execute the long length FetchXML using the WEB API Batch Request.<\/p>\n<p><em><strong>To read more about\u00a0FetchXML visit <a href=\"https:\/\/docs.microsoft.com\/en-us\/dynamics365\/customer-engagement\/developer\/webapi\/retrieve-and-execute-predefined-queries\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a>.<\/strong><\/em><\/p>\n<p><a href=\"https:\/\/www.inogic.com\/product\/productivity-pack\/click-2-export-microsoft-dynamics-crm-reports\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter  wp-image-10864\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2017\/12\/Click2Export-banner.png\" alt=\"Export Dynamics CRM Reports\" width=\"974\" height=\"244\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction: Recently we had a project where we use WEB API for retrieve the records from Dynamics CRM. In our project, we dynamically create FetchXML to retrieve records but sometimes Fetchxml have a lot of columns and conditions etc so its length get increase and we this the fetchxml in URL which violates the browser\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.inogic.com\/blog\/2018\/07\/use-web-api-batch-request-in-dynamics-365-to-execute-long-fetchxml\/\">Read More: Use WEB API Batch Request in Dynamics 365 to execute\u2026 &raquo;<\/a><\/span><\/p>\n","protected":false},"author":13,"featured_media":12520,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16,18,19,65],"tags":[795,1813,1815,1817],"class_list":["post-12519","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dynamics-365","category-dynamics-365-v9-2","category-dynamics-crm","category-webapi","tag-fetchxml","tag-web-api","tag-web-api-dynamics-365","tag-web-api-dynamics-crm"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.8 - aioseo.com -->\n\t<meta name=\"description\" content=\"Introduction: Recently we had a project where we use WEB API for retrieve the records from Dynamics CRM. In our project, we dynamically create FetchXML to retrieve records but sometimes Fetchxml have a lot of columns and conditions etc so its length get increase and we this the fetchxml in URL which violates the browser\" \/>\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\/2018\/07\/use-web-api-batch-request-in-dynamics-365-to-execute-long-fetchxml\/\" \/>\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=\"Use WEB API Batch Request in Dynamics 365 to execute long FetchXML - Microsoft Dynamics 365 CRM Tips and Tricks\" \/>\n\t\t<meta property=\"og:description\" content=\"Introduction: Recently we had a project where we use WEB API for retrieve the records from Dynamics CRM. In our project, we dynamically create FetchXML to retrieve records but sometimes Fetchxml have a lot of columns and conditions etc so its length get increase and we this the fetchxml in URL which violates the browser\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.inogic.com\/blog\/2018\/07\/use-web-api-batch-request-in-dynamics-365-to-execute-long-fetchxml\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2017\/12\/Click2Export-banner.png\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2017\/12\/Click2Export-banner.png\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2018-07-27T10:04:11+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2018-07-27T10:04:11+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=\"Use WEB API Batch Request in Dynamics 365 to execute long FetchXML - Microsoft Dynamics 365 CRM Tips and Tricks\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Introduction: Recently we had a project where we use WEB API for retrieve the records from Dynamics CRM. In our project, we dynamically create FetchXML to retrieve records but sometimes Fetchxml have a lot of columns and conditions etc so its length get increase and we this the fetchxml in URL which violates the browser\" \/>\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\/2017\/12\/Click2Export-banner.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\\\/2018\\\/07\\\/use-web-api-batch-request-in-dynamics-365-to-execute-long-fetchxml\\\/#blogposting\",\"name\":\"Use WEB API Batch Request in Dynamics 365 to execute long FetchXML - Microsoft Dynamics 365 CRM Tips and Tricks\",\"headline\":\"Use WEB API Batch Request in Dynamics 365 to execute long FetchXML\",\"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\\\/2018\\\/07\\\/Use-WEB-API-Batch-Request-in-Dynamics-365-to-execute-long-FetchXML-1-1.png\",\"width\":150,\"height\":150},\"datePublished\":\"2018-07-27T15:34:11+05:30\",\"dateModified\":\"2018-07-27T15:34:11+05:30\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2018\\\/07\\\/use-web-api-batch-request-in-dynamics-365-to-execute-long-fetchxml\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2018\\\/07\\\/use-web-api-batch-request-in-dynamics-365-to-execute-long-fetchxml\\\/#webpage\"},\"articleSection\":\"Dynamics 365, Dynamics 365 v9, Dynamics CRM, WEB API, FetchXML, Web API, Web API Dynamics 365, Web API Dynamics CRM\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2018\\\/07\\\/use-web-api-batch-request-in-dynamics-365-to-execute-long-fetchxml\\\/#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\\\/#listItem\",\"name\":\"Dynamics 365\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/category\\\/dynamics-365\\\/#listItem\",\"position\":2,\"name\":\"Dynamics 365\",\"item\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/category\\\/dynamics-365\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2018\\\/07\\\/use-web-api-batch-request-in-dynamics-365-to-execute-long-fetchxml\\\/#listItem\",\"name\":\"Use WEB API Batch Request in Dynamics 365 to execute long FetchXML\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2018\\\/07\\\/use-web-api-batch-request-in-dynamics-365-to-execute-long-fetchxml\\\/#listItem\",\"position\":3,\"name\":\"Use WEB API Batch Request in Dynamics 365 to execute long FetchXML\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/category\\\/dynamics-365\\\/#listItem\",\"name\":\"Dynamics 365\"}}]},{\"@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\\\/2018\\\/07\\\/use-web-api-batch-request-in-dynamics-365-to-execute-long-fetchxml\\\/#organizationLogo\",\"width\":1000,\"height\":325,\"caption\":\"inogic logo\"},\"image\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2018\\\/07\\\/use-web-api-batch-request-in-dynamics-365-to-execute-long-fetchxml\\\/#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\\\/2018\\\/07\\\/use-web-api-batch-request-in-dynamics-365-to-execute-long-fetchxml\\\/#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\\\/2018\\\/07\\\/use-web-api-batch-request-in-dynamics-365-to-execute-long-fetchxml\\\/#webpage\",\"url\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2018\\\/07\\\/use-web-api-batch-request-in-dynamics-365-to-execute-long-fetchxml\\\/\",\"name\":\"Use WEB API Batch Request in Dynamics 365 to execute long FetchXML - Microsoft Dynamics 365 CRM Tips and Tricks\",\"description\":\"Introduction: Recently we had a project where we use WEB API for retrieve the records from Dynamics CRM. In our project, we dynamically create FetchXML to retrieve records but sometimes Fetchxml have a lot of columns and conditions etc so its length get increase and we this the fetchxml in URL which violates the browser\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2018\\\/07\\\/use-web-api-batch-request-in-dynamics-365-to-execute-long-fetchxml\\\/#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\\\/2018\\\/07\\\/Use-WEB-API-Batch-Request-in-Dynamics-365-to-execute-long-FetchXML-1-1.png\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2018\\\/07\\\/use-web-api-batch-request-in-dynamics-365-to-execute-long-fetchxml\\\/#mainImage\",\"width\":150,\"height\":150},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2018\\\/07\\\/use-web-api-batch-request-in-dynamics-365-to-execute-long-fetchxml\\\/#mainImage\"},\"datePublished\":\"2018-07-27T15:34:11+05:30\",\"dateModified\":\"2018-07-27T15:34:11+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":"Use WEB API Batch Request in Dynamics 365 to execute long FetchXML - Microsoft Dynamics 365 CRM Tips and Tricks","description":"Introduction: Recently we had a project where we use WEB API for retrieve the records from Dynamics CRM. In our project, we dynamically create FetchXML to retrieve records but sometimes Fetchxml have a lot of columns and conditions etc so its length get increase and we this the fetchxml in URL which violates the browser","canonical_url":"https:\/\/www.inogic.com\/blog\/2018\/07\/use-web-api-batch-request-in-dynamics-365-to-execute-long-fetchxml\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BlogPosting","@id":"https:\/\/www.inogic.com\/blog\/2018\/07\/use-web-api-batch-request-in-dynamics-365-to-execute-long-fetchxml\/#blogposting","name":"Use WEB API Batch Request in Dynamics 365 to execute long FetchXML - Microsoft Dynamics 365 CRM Tips and Tricks","headline":"Use WEB API Batch Request in Dynamics 365 to execute long FetchXML","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\/2018\/07\/Use-WEB-API-Batch-Request-in-Dynamics-365-to-execute-long-FetchXML-1-1.png","width":150,"height":150},"datePublished":"2018-07-27T15:34:11+05:30","dateModified":"2018-07-27T15:34:11+05:30","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/www.inogic.com\/blog\/2018\/07\/use-web-api-batch-request-in-dynamics-365-to-execute-long-fetchxml\/#webpage"},"isPartOf":{"@id":"https:\/\/www.inogic.com\/blog\/2018\/07\/use-web-api-batch-request-in-dynamics-365-to-execute-long-fetchxml\/#webpage"},"articleSection":"Dynamics 365, Dynamics 365 v9, Dynamics CRM, WEB API, FetchXML, Web API, Web API Dynamics 365, Web API Dynamics CRM"},{"@type":"BreadcrumbList","@id":"https:\/\/www.inogic.com\/blog\/2018\/07\/use-web-api-batch-request-in-dynamics-365-to-execute-long-fetchxml\/#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\/#listItem","name":"Dynamics 365"}},{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog\/category\/dynamics-365\/#listItem","position":2,"name":"Dynamics 365","item":"https:\/\/www.inogic.com\/blog\/category\/dynamics-365\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog\/2018\/07\/use-web-api-batch-request-in-dynamics-365-to-execute-long-fetchxml\/#listItem","name":"Use WEB API Batch Request in Dynamics 365 to execute long FetchXML"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog\/2018\/07\/use-web-api-batch-request-in-dynamics-365-to-execute-long-fetchxml\/#listItem","position":3,"name":"Use WEB API Batch Request in Dynamics 365 to execute long FetchXML","previousItem":{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog\/category\/dynamics-365\/#listItem","name":"Dynamics 365"}}]},{"@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\/2018\/07\/use-web-api-batch-request-in-dynamics-365-to-execute-long-fetchxml\/#organizationLogo","width":1000,"height":325,"caption":"inogic logo"},"image":{"@id":"https:\/\/www.inogic.com\/blog\/2018\/07\/use-web-api-batch-request-in-dynamics-365-to-execute-long-fetchxml\/#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\/2018\/07\/use-web-api-batch-request-in-dynamics-365-to-execute-long-fetchxml\/#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\/2018\/07\/use-web-api-batch-request-in-dynamics-365-to-execute-long-fetchxml\/#webpage","url":"https:\/\/www.inogic.com\/blog\/2018\/07\/use-web-api-batch-request-in-dynamics-365-to-execute-long-fetchxml\/","name":"Use WEB API Batch Request in Dynamics 365 to execute long FetchXML - Microsoft Dynamics 365 CRM Tips and Tricks","description":"Introduction: Recently we had a project where we use WEB API for retrieve the records from Dynamics CRM. In our project, we dynamically create FetchXML to retrieve records but sometimes Fetchxml have a lot of columns and conditions etc so its length get increase and we this the fetchxml in URL which violates the browser","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.inogic.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/www.inogic.com\/blog\/2018\/07\/use-web-api-batch-request-in-dynamics-365-to-execute-long-fetchxml\/#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\/2018\/07\/Use-WEB-API-Batch-Request-in-Dynamics-365-to-execute-long-FetchXML-1-1.png","@id":"https:\/\/www.inogic.com\/blog\/2018\/07\/use-web-api-batch-request-in-dynamics-365-to-execute-long-fetchxml\/#mainImage","width":150,"height":150},"primaryImageOfPage":{"@id":"https:\/\/www.inogic.com\/blog\/2018\/07\/use-web-api-batch-request-in-dynamics-365-to-execute-long-fetchxml\/#mainImage"},"datePublished":"2018-07-27T15:34:11+05:30","dateModified":"2018-07-27T15:34:11+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":"Use WEB API Batch Request in Dynamics 365 to execute long FetchXML - Microsoft Dynamics 365 CRM Tips and Tricks","og:description":"Introduction: Recently we had a project where we use WEB API for retrieve the records from Dynamics CRM. In our project, we dynamically create FetchXML to retrieve records but sometimes Fetchxml have a lot of columns and conditions etc so its length get increase and we this the fetchxml in URL which violates the browser","og:url":"https:\/\/www.inogic.com\/blog\/2018\/07\/use-web-api-batch-request-in-dynamics-365-to-execute-long-fetchxml\/","og:image":"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2017\/12\/Click2Export-banner.png","og:image:secure_url":"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2017\/12\/Click2Export-banner.png","article:published_time":"2018-07-27T10:04:11+00:00","article:modified_time":"2018-07-27T10:04:11+00:00","article:publisher":"https:\/\/www.facebook.com\/inogicindia","twitter:card":"summary_large_image","twitter:site":"@inogic","twitter:title":"Use WEB API Batch Request in Dynamics 365 to execute long FetchXML - Microsoft Dynamics 365 CRM Tips and Tricks","twitter:description":"Introduction: Recently we had a project where we use WEB API for retrieve the records from Dynamics CRM. In our project, we dynamically create FetchXML to retrieve records but sometimes Fetchxml have a lot of columns and conditions etc so its length get increase and we this the fetchxml in URL which violates the browser","twitter:creator":"@inogic","twitter:image":"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2017\/12\/Click2Export-banner.png","twitter:label1":"Written by","twitter:data1":"Tushar","twitter:label2":"Est. reading time","twitter:data2":"2 minutes"},"aioseo_meta_data":{"post_id":"12519","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 06:55:50","updated":"2025-07-04 04:59:32","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\/\" title=\"Dynamics 365\">Dynamics 365<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tUse WEB API Batch Request in Dynamics 365 to execute long FetchXML\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.inogic.com\/blog"},{"label":"Dynamics 365","link":"https:\/\/www.inogic.com\/blog\/category\/dynamics-365\/"},{"label":"Use WEB API Batch Request in Dynamics 365 to execute long FetchXML","link":"https:\/\/www.inogic.com\/blog\/2018\/07\/use-web-api-batch-request-in-dynamics-365-to-execute-long-fetchxml\/"}],"_links":{"self":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/12519","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=12519"}],"version-history":[{"count":0,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/12519\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media\/12520"}],"wp:attachment":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media?parent=12519"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/categories?post=12519"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/tags?post=12519"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}