{"id":25270,"date":"2020-10-27T12:44:44","date_gmt":"2020-10-27T12:44:44","guid":{"rendered":"https:\/\/www.inogic.com\/blog\/?p=25270"},"modified":"2020-10-27T12:45:22","modified_gmt":"2020-10-27T12:45:22","slug":"how-to-retrieve-entity-metadata-using-xrm-utility-getentitymetadata","status":"publish","type":"post","link":"https:\/\/www.inogic.com\/blog\/2020\/10\/how-to-retrieve-entity-metadata-using-xrm-utility-getentitymetadata\/","title":{"rendered":"How to retrieve entity metadata using Xrm.Utility.getEntityMetadata()"},"content":{"rendered":"<h2>Introduction<\/h2>\n<p style=\"text-align: justify;\">Currently, we need to create http requests to retrieve the metadata of the entity or attributes of any entity. But now, Dynamics 365 introduced a Web API method i.e Xrm.Utility.getEntityMetadata() which helps you retrieve any entity metadata easily without creating any http requests. Please find below two examples to understand this method in detail:<\/p>\n<h3>1. Retrieve whole entity metadata<\/h3>\n<p style=\"text-align: justify;\">Let\u2019s take one example, we want to check if the current entity is activity entity or not. For this query, you can simply use Xrm.Utility.getEntityMetadata, you need to just pass the entity logical name of the entity which you want to retrieve the metadata for, as shown below:<\/p>\n<p>Xrm.Utility.getEntityMetadata(&#8220;account&#8221;, []).then(<\/p>\n<p>function(entityMetadata){<\/p>\n<p>\/\/check for entity metadata<\/p>\n<p>If(entityMetadata!=undefined){<\/p>\n<p>\/\/declare one flag which indicate current entity is activity entity<\/p>\n<p>var isActivityEntity = false;<\/p>\n<p>\/\/check for IsActivity attribute<\/p>\n<p>if (entityMetadata.IsActivity != undefined) {<\/p>\n<p>\/\/check current entity is activity entity using IsActivity attribute<\/p>\n<p>if (entityMetadata.IsActivity == true) {<\/p>\n<p>\/\/set flag to true as current entity is Activity entity<\/p>\n<p>isActivityEntity = true;<\/p>\n<p>} else {<\/p>\n<p>\/\/set flag to false as current entity is not Activity entity<\/p>\n<p>isActivityEntity = true;<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>}, function(e){<\/p>\n<p>\/\/error<\/p>\n<p>alert(e.error.message);<\/p>\n<p>});<\/p>\n<p style=\"text-align: justify;\"><em><strong>Note: We pass the second parameter is empty [] to getEntityMetadata method because in the above example we need to retrieve all metadata of the Account entity.<\/strong><\/em><\/p>\n<p style=\"text-align: justify;\">After running the below code, we will get all the metadata of that entity such as logical name, entity set name, as shown in the below screenshot.<\/p>\n<h1><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/How-to-retrieve-entity-metadata-using-Xrm.Utility.getEntityMetadata-1.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-25271 size-full\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/How-to-retrieve-entity-metadata-using-Xrm.Utility.getEntityMetadata-1.png\" alt=\"\" width=\"1361\" height=\"703\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/How-to-retrieve-entity-metadata-using-Xrm.Utility.getEntityMetadata-1.png 1361w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/How-to-retrieve-entity-metadata-using-Xrm.Utility.getEntityMetadata-1-300x155.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/How-to-retrieve-entity-metadata-using-Xrm.Utility.getEntityMetadata-1-768x397.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/How-to-retrieve-entity-metadata-using-Xrm.Utility.getEntityMetadata-1-1024x529.png 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/How-to-retrieve-entity-metadata-using-Xrm.Utility.getEntityMetadata-1-660x341.png 660w\" sizes=\"(max-width: 1361px) 100vw, 1361px\" \/><\/a><\/h1>\n<h3><strong>2. Retrieve metadata of selected attribute of any entity <\/strong><\/h3>\n<p style=\"text-align: justify;\">Now, we want to retrieve any attribute metadata of any entity that you want in Dynamics 365. Let\u2019s take one example; we want to retrieve metadata of the industry field of Account entity using the getEntityMetadata method. In this scenario, you need to pass those entity names and attributes list for which you want to retrieve metadata, as shown below.<\/p>\n<p>Xrm.Utility.getEntityMetadata(&#8220;account&#8221;, [&#8220;industrycode&#8221;]).then(<\/p>\n<p>function (entityMetadata) {<\/p>\n<p>\/\/check for attribute entity metadata<\/p>\n<p>if (entityMetadata != undefined &amp;&amp; entityMetadata.Attributes != undefined &amp;&amp; entityMetadata.Attributes._collection != undefined) {<\/p>\n<p>\/\/check for industry type option set<\/p>\n<p>if (entityMetadata.Attributes._collection[&#8220;industrycode&#8221;]) {<\/p>\n<p>\/\/get option set data<\/p>\n<p>var industryCodeOptionSetData = entityMetadata.Attributes._collection[&#8220;industrycode&#8221;].OptionSet;<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>}, function(e){<\/p>\n<p>\/\/error call back<\/p>\n<p>alert(e.error.message);<\/p>\n<p>});<\/p>\n<p style=\"text-align: justify;\">After running the above code you will get all options data in the industry field Option Set, as shown in the below screenshot:<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/How-to-retrieve-entity-metadata-using-Xrm.Utility.getEntityMetadata-2.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-25272 size-full\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/How-to-retrieve-entity-metadata-using-Xrm.Utility.getEntityMetadata-2.png\" alt=\"How to retrieve entity metadata using Xrm.Utility.getEntityMetadata\" width=\"1359\" height=\"703\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/How-to-retrieve-entity-metadata-using-Xrm.Utility.getEntityMetadata-2.png 1359w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/How-to-retrieve-entity-metadata-using-Xrm.Utility.getEntityMetadata-2-300x155.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/How-to-retrieve-entity-metadata-using-Xrm.Utility.getEntityMetadata-2-768x397.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/How-to-retrieve-entity-metadata-using-Xrm.Utility.getEntityMetadata-2-1024x530.png 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/How-to-retrieve-entity-metadata-using-Xrm.Utility.getEntityMetadata-2-660x341.png 660w\" sizes=\"(max-width: 1359px) 100vw, 1359px\" \/><\/a><\/p>\n<h2><strong>Conclusion<\/strong><\/h2>\n<p style=\"text-align: justify;\">With help of Xrm.Utility.getEntityMetadata() method you can retrieve metadata of any entity or metadata of any attributes of that entity, you no longer need to create an http request to achieve this.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction Currently, we need to create http requests to retrieve the metadata of the entity or attributes of any entity. But now, Dynamics 365 introduced a Web API method i.e Xrm.Utility.getEntityMetadata() which helps you retrieve any entity metadata easily without creating any http requests. Please find below two examples to understand this method in detail:\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.inogic.com\/blog\/2020\/10\/how-to-retrieve-entity-metadata-using-xrm-utility-getentitymetadata\/\">Read More: How to retrieve entity metadata using Xrm.Utility.getEntityMetadata() &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":[16,18,19,24],"tags":[545,592,740,2084,1474,1854,1859],"class_list":["post-25270","post","type-post","status-publish","format-standard","hentry","category-dynamics-365","category-dynamics-365-v9-2","category-dynamics-crm","category-dynamics-crm-2016","tag-dynamics-365-crm","tag-dynamics-crm","tag-entity","tag-metadata","tag-retrive-metadata","tag-xrm","tag-xrm-utility"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.8 - aioseo.com -->\n\t<meta name=\"description\" content=\"Introduction Currently, we need to create http requests to retrieve the metadata of the entity or attributes of any entity. But now, Dynamics 365 introduced a Web API method i.e Xrm.Utility.getEntityMetadata() which helps you retrieve any entity metadata easily without creating any http requests. Please find below two examples to understand this method in detail:\" \/>\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\/2020\/10\/how-to-retrieve-entity-metadata-using-xrm-utility-getentitymetadata\/\" \/>\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=\"How to retrieve entity metadata using Xrm.Utility.getEntityMetadata() - Microsoft Dynamics 365 CRM Tips and Tricks\" \/>\n\t\t<meta property=\"og:description\" content=\"Introduction Currently, we need to create http requests to retrieve the metadata of the entity or attributes of any entity. But now, Dynamics 365 introduced a Web API method i.e Xrm.Utility.getEntityMetadata() which helps you retrieve any entity metadata easily without creating any http requests. Please find below two examples to understand this method in detail:\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.inogic.com\/blog\/2020\/10\/how-to-retrieve-entity-metadata-using-xrm-utility-getentitymetadata\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/How-to-retrieve-entity-metadata-using-Xrm.Utility.getEntityMetadata-1.png\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/How-to-retrieve-entity-metadata-using-Xrm.Utility.getEntityMetadata-1.png\" \/>\n\t\t<meta property=\"og:image:width\" content=\"1361\" \/>\n\t\t<meta property=\"og:image:height\" content=\"703\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2020-10-27T12:44:44+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2020-10-27T12:45:22+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=\"How to retrieve entity metadata using Xrm.Utility.getEntityMetadata() - Microsoft Dynamics 365 CRM Tips and Tricks\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Introduction Currently, we need to create http requests to retrieve the metadata of the entity or attributes of any entity. But now, Dynamics 365 introduced a Web API method i.e Xrm.Utility.getEntityMetadata() which helps you retrieve any entity metadata easily without creating any http requests. Please find below two examples to understand this method in detail:\" \/>\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\/2020\/10\/How-to-retrieve-entity-metadata-using-Xrm.Utility.getEntityMetadata-1.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\\\/2020\\\/10\\\/how-to-retrieve-entity-metadata-using-xrm-utility-getentitymetadata\\\/#blogposting\",\"name\":\"How to retrieve entity metadata using Xrm.Utility.getEntityMetadata() - Microsoft Dynamics 365 CRM Tips and Tricks\",\"headline\":\"How to retrieve entity metadata using Xrm.Utility.getEntityMetadata()\",\"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\\\/2020\\\/10\\\/How-to-retrieve-entity-metadata-using-Xrm.Utility.getEntityMetadata-1.png\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2020\\\/10\\\/how-to-retrieve-entity-metadata-using-xrm-utility-getentitymetadata\\\/#articleImage\",\"width\":1361,\"height\":703,\"caption\":\"How to retrieve entity metadata using Xrm.Utility.getEntityMetadata\"},\"datePublished\":\"2020-10-27T12:44:44+05:30\",\"dateModified\":\"2020-10-27T12:45:22+05:30\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2020\\\/10\\\/how-to-retrieve-entity-metadata-using-xrm-utility-getentitymetadata\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2020\\\/10\\\/how-to-retrieve-entity-metadata-using-xrm-utility-getentitymetadata\\\/#webpage\"},\"articleSection\":\"Dynamics 365, Dynamics 365 v9, Dynamics CRM, Dynamics CRM 2016, Dynamics 365 CRM, Dynamics CRM, Entity, metadata, Retrive metadata, XRM, Xrm.Utility\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2020\\\/10\\\/how-to-retrieve-entity-metadata-using-xrm-utility-getentitymetadata\\\/#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\\\/2020\\\/10\\\/how-to-retrieve-entity-metadata-using-xrm-utility-getentitymetadata\\\/#listItem\",\"name\":\"How to retrieve entity metadata using Xrm.Utility.getEntityMetadata()\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/category\\\/dynamics-crm\\\/#listItem\",\"name\":\"Dynamics CRM\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2020\\\/10\\\/how-to-retrieve-entity-metadata-using-xrm-utility-getentitymetadata\\\/#listItem\",\"position\":4,\"name\":\"How to retrieve entity metadata using Xrm.Utility.getEntityMetadata()\",\"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\\\/2020\\\/10\\\/how-to-retrieve-entity-metadata-using-xrm-utility-getentitymetadata\\\/#organizationLogo\",\"width\":1000,\"height\":325,\"caption\":\"inogic logo\"},\"image\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2020\\\/10\\\/how-to-retrieve-entity-metadata-using-xrm-utility-getentitymetadata\\\/#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\\\/2020\\\/10\\\/how-to-retrieve-entity-metadata-using-xrm-utility-getentitymetadata\\\/#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\\\/2020\\\/10\\\/how-to-retrieve-entity-metadata-using-xrm-utility-getentitymetadata\\\/#webpage\",\"url\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2020\\\/10\\\/how-to-retrieve-entity-metadata-using-xrm-utility-getentitymetadata\\\/\",\"name\":\"How to retrieve entity metadata using Xrm.Utility.getEntityMetadata() - Microsoft Dynamics 365 CRM Tips and Tricks\",\"description\":\"Introduction Currently, we need to create http requests to retrieve the metadata of the entity or attributes of any entity. But now, Dynamics 365 introduced a Web API method i.e Xrm.Utility.getEntityMetadata() which helps you retrieve any entity metadata easily without creating any http requests. Please find below two examples to understand this method in detail:\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2020\\\/10\\\/how-to-retrieve-entity-metadata-using-xrm-utility-getentitymetadata\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/author\\\/inogic-2\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/author\\\/inogic-2\\\/#author\"},\"datePublished\":\"2020-10-27T12:44:44+05:30\",\"dateModified\":\"2020-10-27T12:45:22+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":"How to retrieve entity metadata using Xrm.Utility.getEntityMetadata() - Microsoft Dynamics 365 CRM Tips and Tricks","description":"Introduction Currently, we need to create http requests to retrieve the metadata of the entity or attributes of any entity. But now, Dynamics 365 introduced a Web API method i.e Xrm.Utility.getEntityMetadata() which helps you retrieve any entity metadata easily without creating any http requests. Please find below two examples to understand this method in detail:","canonical_url":"https:\/\/www.inogic.com\/blog\/2020\/10\/how-to-retrieve-entity-metadata-using-xrm-utility-getentitymetadata\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BlogPosting","@id":"https:\/\/www.inogic.com\/blog\/2020\/10\/how-to-retrieve-entity-metadata-using-xrm-utility-getentitymetadata\/#blogposting","name":"How to retrieve entity metadata using Xrm.Utility.getEntityMetadata() - Microsoft Dynamics 365 CRM Tips and Tricks","headline":"How to retrieve entity metadata using Xrm.Utility.getEntityMetadata()","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\/2020\/10\/How-to-retrieve-entity-metadata-using-Xrm.Utility.getEntityMetadata-1.png","@id":"https:\/\/www.inogic.com\/blog\/2020\/10\/how-to-retrieve-entity-metadata-using-xrm-utility-getentitymetadata\/#articleImage","width":1361,"height":703,"caption":"How to retrieve entity metadata using Xrm.Utility.getEntityMetadata"},"datePublished":"2020-10-27T12:44:44+05:30","dateModified":"2020-10-27T12:45:22+05:30","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/www.inogic.com\/blog\/2020\/10\/how-to-retrieve-entity-metadata-using-xrm-utility-getentitymetadata\/#webpage"},"isPartOf":{"@id":"https:\/\/www.inogic.com\/blog\/2020\/10\/how-to-retrieve-entity-metadata-using-xrm-utility-getentitymetadata\/#webpage"},"articleSection":"Dynamics 365, Dynamics 365 v9, Dynamics CRM, Dynamics CRM 2016, Dynamics 365 CRM, Dynamics CRM, Entity, metadata, Retrive metadata, XRM, Xrm.Utility"},{"@type":"BreadcrumbList","@id":"https:\/\/www.inogic.com\/blog\/2020\/10\/how-to-retrieve-entity-metadata-using-xrm-utility-getentitymetadata\/#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\/2020\/10\/how-to-retrieve-entity-metadata-using-xrm-utility-getentitymetadata\/#listItem","name":"How to retrieve entity metadata using Xrm.Utility.getEntityMetadata()"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog\/category\/dynamics-crm\/#listItem","name":"Dynamics CRM"}},{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog\/2020\/10\/how-to-retrieve-entity-metadata-using-xrm-utility-getentitymetadata\/#listItem","position":4,"name":"How to retrieve entity metadata using Xrm.Utility.getEntityMetadata()","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\/2020\/10\/how-to-retrieve-entity-metadata-using-xrm-utility-getentitymetadata\/#organizationLogo","width":1000,"height":325,"caption":"inogic logo"},"image":{"@id":"https:\/\/www.inogic.com\/blog\/2020\/10\/how-to-retrieve-entity-metadata-using-xrm-utility-getentitymetadata\/#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\/2020\/10\/how-to-retrieve-entity-metadata-using-xrm-utility-getentitymetadata\/#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\/2020\/10\/how-to-retrieve-entity-metadata-using-xrm-utility-getentitymetadata\/#webpage","url":"https:\/\/www.inogic.com\/blog\/2020\/10\/how-to-retrieve-entity-metadata-using-xrm-utility-getentitymetadata\/","name":"How to retrieve entity metadata using Xrm.Utility.getEntityMetadata() - Microsoft Dynamics 365 CRM Tips and Tricks","description":"Introduction Currently, we need to create http requests to retrieve the metadata of the entity or attributes of any entity. But now, Dynamics 365 introduced a Web API method i.e Xrm.Utility.getEntityMetadata() which helps you retrieve any entity metadata easily without creating any http requests. Please find below two examples to understand this method in detail:","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.inogic.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/www.inogic.com\/blog\/2020\/10\/how-to-retrieve-entity-metadata-using-xrm-utility-getentitymetadata\/#breadcrumblist"},"author":{"@id":"https:\/\/www.inogic.com\/blog\/author\/inogic-2\/#author"},"creator":{"@id":"https:\/\/www.inogic.com\/blog\/author\/inogic-2\/#author"},"datePublished":"2020-10-27T12:44:44+05:30","dateModified":"2020-10-27T12:45:22+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":"How to retrieve entity metadata using Xrm.Utility.getEntityMetadata() - Microsoft Dynamics 365 CRM Tips and Tricks","og:description":"Introduction Currently, we need to create http requests to retrieve the metadata of the entity or attributes of any entity. But now, Dynamics 365 introduced a Web API method i.e Xrm.Utility.getEntityMetadata() which helps you retrieve any entity metadata easily without creating any http requests. Please find below two examples to understand this method in detail:","og:url":"https:\/\/www.inogic.com\/blog\/2020\/10\/how-to-retrieve-entity-metadata-using-xrm-utility-getentitymetadata\/","og:image":"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/How-to-retrieve-entity-metadata-using-Xrm.Utility.getEntityMetadata-1.png","og:image:secure_url":"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/How-to-retrieve-entity-metadata-using-Xrm.Utility.getEntityMetadata-1.png","og:image:width":1361,"og:image:height":703,"article:published_time":"2020-10-27T12:44:44+00:00","article:modified_time":"2020-10-27T12:45:22+00:00","article:publisher":"https:\/\/www.facebook.com\/inogicindia","twitter:card":"summary_large_image","twitter:site":"@inogic","twitter:title":"How to retrieve entity metadata using Xrm.Utility.getEntityMetadata() - Microsoft Dynamics 365 CRM Tips and Tricks","twitter:description":"Introduction Currently, we need to create http requests to retrieve the metadata of the entity or attributes of any entity. But now, Dynamics 365 introduced a Web API method i.e Xrm.Utility.getEntityMetadata() which helps you retrieve any entity metadata easily without creating any http requests. Please find below two examples to understand this method in detail:","twitter:creator":"@inogic","twitter:image":"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/How-to-retrieve-entity-metadata-using-Xrm.Utility.getEntityMetadata-1.png","twitter:label1":"Written by","twitter:data1":"Tushar","twitter:label2":"Est. reading time","twitter:data2":"2 minutes"},"aioseo_meta_data":{"post_id":"25270","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":"BlogPosting","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:17:09","updated":"2025-07-04 08: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-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\tHow to retrieve entity metadata using Xrm.Utility.getEntityMetadata()\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":"How to retrieve entity metadata using Xrm.Utility.getEntityMetadata()","link":"https:\/\/www.inogic.com\/blog\/2020\/10\/how-to-retrieve-entity-metadata-using-xrm-utility-getentitymetadata\/"}],"_links":{"self":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/25270","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=25270"}],"version-history":[{"count":0,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/25270\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media?parent=25270"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/categories?post=25270"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/tags?post=25270"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}