{"id":3681,"date":"2016-10-05T17:53:39","date_gmt":"2016-10-05T12:23:39","guid":{"rendered":"https:\/\/www.inogic.com\/blog\/?p=3681"},"modified":"2022-09-02T16:32:34","modified_gmt":"2022-09-02T11:02:34","slug":"retrieve-update-and-delete-record-using-alternate-key-in-dynamics-crm-web-api","status":"publish","type":"post","link":"https:\/\/www.inogic.com\/blog\/2016\/10\/retrieve-update-and-delete-record-using-alternate-key-in-dynamics-crm-web-api\/","title":{"rendered":"Retrieve, Update and Delete Record Using Alternate Key in Dynamics CRM Web API"},"content":{"rendered":"<p>Before Alternate key concept was introduced in Dynamics CRM it used to be the only GUID of the record which was used to retrieve, update or delete any record. Hence we had to get the record GUID first for any retrieve, update or delete operation. But with the introduction of Alternate keys concept this overhead of getting record GUID went away as we got an alternative way to create any field as Alternate Key and use it. Let\u2019s see how we can perform these operations using Web API now with the help of Alternate keys.<\/p>\n<p><strong>Delete operation in Web API using Alternate key:<\/strong><\/p>\n<pre class=\"lang:default decode:true \">function DeleteEntityRecord() {\r\n    var functionName = \"DeleteEntityRecord\";\r\n    try {\r\n        \/\/get Server url\r\n        var serverURL = Xrm.Page.context.getClientUrl();\r\n        \r\n        var xhr = new XMLHttpRequest();\r\n        \r\n        xhr.open(\"DELETE\", serverURL + \"\/api\/data\/v8.0\/accounts(accountnumber='AFFSE9IK\u2032)')\", true);\r\n        xhr.setRequestHeader(\"Accept\", \"application\/json\");\r\n        xhr.setRequestHeader(\"Content-Type\", \"application\/json; charset=utf-8\");\r\n        xhr.setRequestHeader(\"OData-MaxVersion\", \"4.0\");\r\n        xhr.setRequestHeader(\"OData-Version\", \"4.0\");\r\n        xhr.onreadystatechange = function () {\r\n            if (this.readyState == 4) {\r\n                xhr.onreadystatechange = null;\r\n                if (this.status == 204) {\r\n                    \/\/show alert\r\n                    Xrm.Utility.alertDialog('Record Deleted Successfully.');\r\n                }\r\n                else {\r\n                    var error = JSON.parse(this.response).error;\r\n                    \/\/show error\r\n                    Xrm.Utility.alertDialog(error.message);\r\n                }\r\n            }\r\n        };\r\n        xhr.send();\r\n    } catch (e) {\r\n        Xrm.Utility.alertDialog(functionName + (e.message || e.description));\r\n    }\r\n}<\/pre>\n<p>In above operation \u201caccountnumber\u201d is Alternate key using which we have performed delete operation.<\/p>\n<p><strong>Update operation in Web API using Alternate key:<\/strong><\/p>\n<pre class=\"lang:default decode:true \">function UpdateEntityRecord() {\r\n    var functionName = \"UpdateEntityRecord\";\r\n    try {\r\n        \/\/get Server url\r\n        var serverURL = Xrm.Page.context.getClientUrl();\r\n\r\n        var xhr = new XMLHttpRequest();\r\n\r\n        xhr.open(\"PATCH\", serverURL + \"\/api\/data\/v8.0\/contacts(emailaddress1='Adrian@adventure-works.com')\", true);\r\n        xhr.setRequestHeader(\"Accept\", \"application\/json\");\r\n        xhr.setRequestHeader(\"Content-Type\", \"application\/json; charset=utf-8\");\r\n        xhr.setRequestHeader(\"OData-MaxVersion\", \"4.0\");\r\n        xhr.setRequestHeader(\"OData-Version\", \"4.0\");\r\n        xhr.onreadystatechange = function () {\r\n            if (this.readyState == 4) {\r\n                xhr.onreadystatechange = null;\r\n                if (this.status == 204) {\r\n                    \/\/show alert\r\n                    Xrm.Utility.alertDialog('Record Updated Successfully.');\r\n                }\r\n                else {\r\n                    var error = JSON.parse(this.response).error;\r\n                    \/\/show error\r\n                    Xrm.Utility.alertDialog(error.message);\r\n                }\r\n            }\r\n        };\r\n        var objContact = {};\r\n        objContact.firstname = \"Sam\";\r\n        objContact.lastname = \"Dsouza\";\r\n\r\n\r\n        var body = JSON.stringify(objContact);\r\n        xhr.send(body);\r\n    } catch (e) {\r\n        Xrm.Utility.alertDialog(functionName + (e.message || e.description));\r\n    }\r\n}<\/pre>\n<p>In above operation \u201cemailaddress1\u201d is Alternate key using which we have performed update operation.<\/p>\n<p><strong>Retrieve operation in Web API using Alternate key:<\/strong><\/p>\n<pre class=\"lang:default decode:true \">function getEntityByAlternateKey() {\r\n    try {\r\n        var clientUrl = Xrm.Page.context.getClientUrl();\r\n        var xhr = new XMLHttpRequest();\r\n        \r\n        xhr.open(\"GET\", encodeURI(clientUrl + \"\/api\/data\/v8.0\/contacts(mobilephone=\u20199568565458\u2032)\"), true);\r\n\r\n        \/\/ For Multiple Alternate keys use like this\r\n        \/\/req.open(\"GET\", encodeURI(clientUrl + \"\/api\/data\/v8.0\/contacts(mobilephone=\u20199568565458\u2032,emailaddress1=\u2019Adrian@adventure-works.com\u2019)\"), true);\r\n\r\n        xhr.setRequestHeader(\"Accept\", \"application\/json\");\r\n        xhr.setRequestHeader(\"Content-Type\", \"application\/json; charset=utf-8\");\r\n        xhr.setRequestHeader(\"OData-MaxVersion\", \"4.0\");\r\n        xhr.setRequestHeader(\"OData-Version\", \"4.0\");\r\n        xhr.onreadystatechange = function () {\r\n            if (this.readyState == 4) {\r\n                xhr.onreadystatechange = null;\r\n                if (this.status == 200) {\r\n                    var data = JSON.parse(this.response);\r\n                    var dat = data.value;\r\n                    for (var i = 0; i &lt; dat.length; i++) {\r\n                        var contId = dat[i].contactid;\r\n                        Xrm.Utility.alertDialog(\"Entity Id : \" + contId);\r\n                    }\r\n                }\r\n                else {\r\n                    var error = JSON.parse(this.response).error;\r\n                    Xrm.Utility.alertDialog(\"Error retrieving Entity- \" + error.message);\r\n                }\r\n            }\r\n        };\r\n\r\n        xhr.send();\r\n    } catch (e) {\r\n        Xrm.Utility.alertDialog(\"Error in getting Entity by alternate key \u2013 \" + e.description);\r\n    }\r\n}<\/pre>\n<p>In above operation \u201cmobilephone\u201d is Alternate key using which we have performed retrieve operation.<\/p>\n<p>In this way Alternate keys concept can be used for different operations like to retrieve, update, or delete any record.<\/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\">Generate Your Own New Leads Within Microsoft Dynamics 365 CRM<\/div><\/div><\/h2>\n<p><em>Contact us for a <a href=\"https:\/\/www.maplytics.com\/maplytics-download\/?utm_source=highvisits&amp;utm_medium=technicalblog&amp;utm_campaign=hMaplytics\" target=\"_blank\" rel=\"noopener\">demo<\/a> to know more about how <a href=\"https:\/\/www.maplytics.com\/?utm_source=highvisits&amp;utm_medium=technicalblog&amp;utm_campaign=hMaplytics\" target=\"_blank\" rel=\"noopener\">Maplytics<\/a> can help you to generate new leads from within Microsoft Dynamics 365 CRM.<\/em><\/p>\n<p><em><a href=\"https:\/\/www.maplytics.com\/?utm_source=highvisits&amp;utm_medium=technicalblog&amp;utm_campaign=hMaplytics\" target=\"_blank\" rel=\"noopener\">Maplytics<\/a> is a 5-star rated, preferred business app on the <a href=\"https:\/\/appsource.microsoft.com\/en-us\/product\/dynamics-365\/inogic.f6f3c73f-29de-4fa8-a396-87ea8a07b6c4?tab=Overview\" target=\"_blank\" rel=\"noopener\">Microsoft AppSource<\/a> that is Certified for Microsoft Dynamics 365 (CfMD) and comes with powerful features like Appointment Planning, Sales Routing, Territory Management, Heat Maps, Geo-analytical Dashboards and more that empower organizations to add more value to their CRM data, improve sales &amp; service processes, and achieve high ROI.<\/em><\/p>\n<p><em>Get your <a href=\"https:\/\/www.maplytics.com\/maplytics-download\/?utm_source=highvisits&amp;utm_medium=technicalblog&amp;utm_campaign=hMaplytics\" target=\"_blank\" rel=\"noopener\">free trial<\/a> from our Website or <a href=\"https:\/\/appsource.microsoft.com\/en-us\/product\/dynamics-365\/inogic.f6f3c73f-29de-4fa8-a396-87ea8a07b6c4?tab=Overview\" target=\"_blank\" rel=\"noopener\">Microsoft AppSource<\/a>!<\/em><\/p>\n<p><em>&#8216;If data is the new oil, location intelligence is ??\u201d<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Before Alternate key concept was introduced in Dynamics CRM it used to be the only GUID of the record which was used to retrieve, update or delete any record. Hence we had to get the record GUID first for any retrieve, update or delete operation. But with the introduction of Alternate keys concept this overhead\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.inogic.com\/blog\/2016\/10\/retrieve-update-and-delete-record-using-alternate-key-in-dynamics-crm-web-api\/\">Read More: Retrieve, Update and Delete Record Using Alternate Key in Dynamics\u2026 &raquo;<\/a><\/span><\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19,24,33,65],"tags":[127,708,1145,1146,1222],"class_list":["post-3681","post","type-post","status-publish","format-standard","hentry","category-dynamics-crm","category-dynamics-crm-2016","category-javascript","category-webapi","tag-alternate-key-feature-in-web-api","tag-dynamics-crm-web-api","tag-microsoft-dynamics-crm-web-api","tag-microsoft-dynamics-crm-web-api-alternate-key-feature","tag-ms-dynamics-crm-web-api"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.8 - aioseo.com -->\n\t<meta name=\"description\" content=\"In this way Alternate keys concept can be used for different operations like to retrieve, update, or delete any record.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Inogic\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.inogic.com\/blog\/2016\/10\/retrieve-update-and-delete-record-using-alternate-key-in-dynamics-crm-web-api\/\" \/>\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=\"Retrieve, Update and Delete Record Using Alternate Key in Dynamics CRM Web API - Microsoft Dynamics 365 CRM Tips and Tricks\" \/>\n\t\t<meta property=\"og:description\" content=\"In this way Alternate keys concept can be used for different operations like to retrieve, update, or delete any record.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.inogic.com\/blog\/2016\/10\/retrieve-update-and-delete-record-using-alternate-key-in-dynamics-crm-web-api\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2016-10-05T12:23:39+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2022-09-02T11:02:34+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=\"Retrieve, Update and Delete Record Using Alternate Key in Dynamics CRM Web API - Microsoft Dynamics 365 CRM Tips and Tricks\" \/>\n\t\t<meta name=\"twitter:description\" content=\"In this way Alternate keys concept can be used for different operations like to retrieve, update, or delete any record.\" \/>\n\t\t<meta name=\"twitter:creator\" content=\"@inogic\" \/>\n\t\t<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t\t<meta name=\"twitter:data1\" content=\"Inogic\" \/>\n\t\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t\t<meta name=\"twitter:data2\" content=\"3 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\\\/2016\\\/10\\\/retrieve-update-and-delete-record-using-alternate-key-in-dynamics-crm-web-api\\\/#blogposting\",\"name\":\"Retrieve, Update and Delete Record Using Alternate Key in Dynamics CRM Web API - Microsoft Dynamics 365 CRM Tips and Tricks\",\"headline\":\"Retrieve, Update and Delete Record Using Alternate Key in Dynamics CRM Web API\",\"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\\\/2023\\\/02\\\/inogic-logo.png\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/#articleImage\",\"width\":1000,\"height\":325,\"caption\":\"inogic logo\"},\"datePublished\":\"2016-10-05T17:53:39+05:30\",\"dateModified\":\"2022-09-02T16:32:34+05:30\",\"inLanguage\":\"en-US\",\"commentCount\":2,\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2016\\\/10\\\/retrieve-update-and-delete-record-using-alternate-key-in-dynamics-crm-web-api\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2016\\\/10\\\/retrieve-update-and-delete-record-using-alternate-key-in-dynamics-crm-web-api\\\/#webpage\"},\"articleSection\":\"Dynamics CRM, Dynamics CRM 2016, JavaScript, WEB API, Alternate key feature in WEB API, Dynamics CRM Web API, Microsoft Dynamics CRM Web API, Microsoft Dynamics CRM WEB API alternate key feature, MS Dynamics CRM Web API\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2016\\\/10\\\/retrieve-update-and-delete-record-using-alternate-key-in-dynamics-crm-web-api\\\/#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-crm\\\/#listItem\",\"name\":\"Dynamics CRM\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/category\\\/dynamics-crm\\\/#listItem\",\"position\":2,\"name\":\"Dynamics CRM\",\"item\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/category\\\/dynamics-crm\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/category\\\/dynamics-crm\\\/dynamics-crm-2016\\\/#listItem\",\"name\":\"Dynamics CRM 2016\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/category\\\/dynamics-crm\\\/dynamics-crm-2016\\\/#listItem\",\"position\":3,\"name\":\"Dynamics CRM 2016\",\"item\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/category\\\/dynamics-crm\\\/dynamics-crm-2016\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2016\\\/10\\\/retrieve-update-and-delete-record-using-alternate-key-in-dynamics-crm-web-api\\\/#listItem\",\"name\":\"Retrieve, Update and Delete Record Using Alternate Key in Dynamics CRM Web API\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/category\\\/dynamics-crm\\\/#listItem\",\"name\":\"Dynamics CRM\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2016\\\/10\\\/retrieve-update-and-delete-record-using-alternate-key-in-dynamics-crm-web-api\\\/#listItem\",\"position\":4,\"name\":\"Retrieve, Update and Delete Record Using Alternate Key in Dynamics CRM Web API\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/category\\\/dynamics-crm\\\/dynamics-crm-2016\\\/#listItem\",\"name\":\"Dynamics CRM 2016\"}}]},{\"@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\\\/2016\\\/10\\\/retrieve-update-and-delete-record-using-alternate-key-in-dynamics-crm-web-api\\\/#organizationLogo\",\"width\":1000,\"height\":325,\"caption\":\"inogic logo\"},\"image\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2016\\\/10\\\/retrieve-update-and-delete-record-using-alternate-key-in-dynamics-crm-web-api\\\/#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\":\"Inogic\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2016\\\/10\\\/retrieve-update-and-delete-record-using-alternate-key-in-dynamics-crm-web-api\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/839d9ae7d2b941d2d09e91df322267a429821f2ce5494302b53bd5ca3679f1a0?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Inogic\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2016\\\/10\\\/retrieve-update-and-delete-record-using-alternate-key-in-dynamics-crm-web-api\\\/#webpage\",\"url\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2016\\\/10\\\/retrieve-update-and-delete-record-using-alternate-key-in-dynamics-crm-web-api\\\/\",\"name\":\"Retrieve, Update and Delete Record Using Alternate Key in Dynamics CRM Web API - Microsoft Dynamics 365 CRM Tips and Tricks\",\"description\":\"In this way Alternate keys concept can be used for different operations like to retrieve, update, or delete any record.\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2016\\\/10\\\/retrieve-update-and-delete-record-using-alternate-key-in-dynamics-crm-web-api\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/author\\\/inogic-2\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/author\\\/inogic-2\\\/#author\"},\"datePublished\":\"2016-10-05T17:53:39+05:30\",\"dateModified\":\"2022-09-02T16:32:34+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":"Retrieve, Update and Delete Record Using Alternate Key in Dynamics CRM Web API - Microsoft Dynamics 365 CRM Tips and Tricks","description":"In this way Alternate keys concept can be used for different operations like to retrieve, update, or delete any record.","canonical_url":"https:\/\/www.inogic.com\/blog\/2016\/10\/retrieve-update-and-delete-record-using-alternate-key-in-dynamics-crm-web-api\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BlogPosting","@id":"https:\/\/www.inogic.com\/blog\/2016\/10\/retrieve-update-and-delete-record-using-alternate-key-in-dynamics-crm-web-api\/#blogposting","name":"Retrieve, Update and Delete Record Using Alternate Key in Dynamics CRM Web API - Microsoft Dynamics 365 CRM Tips and Tricks","headline":"Retrieve, Update and Delete Record Using Alternate Key in Dynamics CRM Web API","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\/2023\/02\/inogic-logo.png","@id":"https:\/\/www.inogic.com\/blog\/#articleImage","width":1000,"height":325,"caption":"inogic logo"},"datePublished":"2016-10-05T17:53:39+05:30","dateModified":"2022-09-02T16:32:34+05:30","inLanguage":"en-US","commentCount":2,"mainEntityOfPage":{"@id":"https:\/\/www.inogic.com\/blog\/2016\/10\/retrieve-update-and-delete-record-using-alternate-key-in-dynamics-crm-web-api\/#webpage"},"isPartOf":{"@id":"https:\/\/www.inogic.com\/blog\/2016\/10\/retrieve-update-and-delete-record-using-alternate-key-in-dynamics-crm-web-api\/#webpage"},"articleSection":"Dynamics CRM, Dynamics CRM 2016, JavaScript, WEB API, Alternate key feature in WEB API, Dynamics CRM Web API, Microsoft Dynamics CRM Web API, Microsoft Dynamics CRM WEB API alternate key feature, MS Dynamics CRM Web API"},{"@type":"BreadcrumbList","@id":"https:\/\/www.inogic.com\/blog\/2016\/10\/retrieve-update-and-delete-record-using-alternate-key-in-dynamics-crm-web-api\/#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-crm\/#listItem","name":"Dynamics CRM"}},{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog\/category\/dynamics-crm\/#listItem","position":2,"name":"Dynamics CRM","item":"https:\/\/www.inogic.com\/blog\/category\/dynamics-crm\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog\/category\/dynamics-crm\/dynamics-crm-2016\/#listItem","name":"Dynamics CRM 2016"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog\/category\/dynamics-crm\/dynamics-crm-2016\/#listItem","position":3,"name":"Dynamics CRM 2016","item":"https:\/\/www.inogic.com\/blog\/category\/dynamics-crm\/dynamics-crm-2016\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog\/2016\/10\/retrieve-update-and-delete-record-using-alternate-key-in-dynamics-crm-web-api\/#listItem","name":"Retrieve, Update and Delete Record Using Alternate Key in Dynamics CRM Web API"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog\/category\/dynamics-crm\/#listItem","name":"Dynamics CRM"}},{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog\/2016\/10\/retrieve-update-and-delete-record-using-alternate-key-in-dynamics-crm-web-api\/#listItem","position":4,"name":"Retrieve, Update and Delete Record Using Alternate Key in Dynamics CRM Web API","previousItem":{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog\/category\/dynamics-crm\/dynamics-crm-2016\/#listItem","name":"Dynamics CRM 2016"}}]},{"@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\/2016\/10\/retrieve-update-and-delete-record-using-alternate-key-in-dynamics-crm-web-api\/#organizationLogo","width":1000,"height":325,"caption":"inogic logo"},"image":{"@id":"https:\/\/www.inogic.com\/blog\/2016\/10\/retrieve-update-and-delete-record-using-alternate-key-in-dynamics-crm-web-api\/#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":"Inogic","image":{"@type":"ImageObject","@id":"https:\/\/www.inogic.com\/blog\/2016\/10\/retrieve-update-and-delete-record-using-alternate-key-in-dynamics-crm-web-api\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/839d9ae7d2b941d2d09e91df322267a429821f2ce5494302b53bd5ca3679f1a0?s=96&d=mm&r=g","width":96,"height":96,"caption":"Inogic"}},{"@type":"WebPage","@id":"https:\/\/www.inogic.com\/blog\/2016\/10\/retrieve-update-and-delete-record-using-alternate-key-in-dynamics-crm-web-api\/#webpage","url":"https:\/\/www.inogic.com\/blog\/2016\/10\/retrieve-update-and-delete-record-using-alternate-key-in-dynamics-crm-web-api\/","name":"Retrieve, Update and Delete Record Using Alternate Key in Dynamics CRM Web API - Microsoft Dynamics 365 CRM Tips and Tricks","description":"In this way Alternate keys concept can be used for different operations like to retrieve, update, or delete any record.","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.inogic.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/www.inogic.com\/blog\/2016\/10\/retrieve-update-and-delete-record-using-alternate-key-in-dynamics-crm-web-api\/#breadcrumblist"},"author":{"@id":"https:\/\/www.inogic.com\/blog\/author\/inogic-2\/#author"},"creator":{"@id":"https:\/\/www.inogic.com\/blog\/author\/inogic-2\/#author"},"datePublished":"2016-10-05T17:53:39+05:30","dateModified":"2022-09-02T16:32:34+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":"Retrieve, Update and Delete Record Using Alternate Key in Dynamics CRM Web API - Microsoft Dynamics 365 CRM Tips and Tricks","og:description":"In this way Alternate keys concept can be used for different operations like to retrieve, update, or delete any record.","og:url":"https:\/\/www.inogic.com\/blog\/2016\/10\/retrieve-update-and-delete-record-using-alternate-key-in-dynamics-crm-web-api\/","article:published_time":"2016-10-05T12:23:39+00:00","article:modified_time":"2022-09-02T11:02:34+00:00","article:publisher":"https:\/\/www.facebook.com\/inogicindia","twitter:card":"summary_large_image","twitter:site":"@inogic","twitter:title":"Retrieve, Update and Delete Record Using Alternate Key in Dynamics CRM Web API - Microsoft Dynamics 365 CRM Tips and Tricks","twitter:description":"In this way Alternate keys concept can be used for different operations like to retrieve, update, or delete any record.","twitter:creator":"@inogic","twitter:label1":"Written by","twitter:data1":"Inogic","twitter:label2":"Est. reading time","twitter:data2":"3 minutes"},"aioseo_meta_data":{"post_id":"3681","title":null,"description":"In this way Alternate keys concept can be used for different operations like to retrieve, update, or delete any record.","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:31:45","updated":"2025-07-04 02:14:21","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-crm\/\" title=\"Dynamics CRM\">Dynamics CRM<\/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-crm\/dynamics-crm-2016\/\" title=\"Dynamics CRM 2016\">Dynamics CRM 2016<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tRetrieve, Update and Delete Record Using Alternate Key in Dynamics CRM Web API\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.inogic.com\/blog"},{"label":"Dynamics CRM","link":"https:\/\/www.inogic.com\/blog\/category\/dynamics-crm\/"},{"label":"Dynamics CRM 2016","link":"https:\/\/www.inogic.com\/blog\/category\/dynamics-crm\/dynamics-crm-2016\/"},{"label":"Retrieve, Update and Delete Record Using Alternate Key in Dynamics CRM Web API","link":"https:\/\/www.inogic.com\/blog\/2016\/10\/retrieve-update-and-delete-record-using-alternate-key-in-dynamics-crm-web-api\/"}],"_links":{"self":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/3681","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=3681"}],"version-history":[{"count":0,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/3681\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media?parent=3681"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/categories?post=3681"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/tags?post=3681"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}