{"id":28017,"date":"2021-05-26T11:52:45","date_gmt":"2021-05-26T11:52:45","guid":{"rendered":"https:\/\/www.inogic.com\/blog\/?p=28017"},"modified":"2021-09-01T09:46:15","modified_gmt":"2021-09-01T09:46:15","slug":"how-to-get-the-entity-form-details-using-xrm-utility-getentitymainformdescriptor-client-api","status":"publish","type":"post","link":"https:\/\/www.inogic.com\/blog\/2021\/05\/how-to-get-the-entity-form-details-using-xrm-utility-getentitymainformdescriptor-client-api\/","title":{"rendered":"How to get the Entity Form details using Xrm.Utility.getEntityMainFormDescriptor Client API"},"content":{"rendered":"<h2 style=\"text-align: justify;\"><strong>Introduction<\/strong><\/h2>\n<p style=\"text-align: justify;\">Normally, using Xrm.Utility.getEntityMainFormDescriptor Client API, we get the details of default main form of specified entity in the form of sections and attributes list. If we want to get the list of all the entity attributes or sections that is visible on an entity form, then we can use this Client API. In this blog, we have explained the use of this Client API through the below example.<\/p>\n<p style=\"text-align: justify;\">In our recent project, we had a requirement to design an HTML form where we show entity form sections (that is visible on entity form) of specified entity. For this, we have to retrieve sections of the entity main form of the given entity. To achieve this requirement, we used Xrm.Utility.getEntityMainFormDescriptor Client API of Dynamics 365 CRM.<\/p>\n<p style=\"text-align: justify;\">Please find below the code where we have shown how to use Xrm.Utility.getEntityMainFormDescriptor Client API.<\/p>\n<p style=\"text-align: justify;\">Here, we have passed the account entity main form id and a logical name.<\/p>\n<p style=\"text-align: justify;\"><code>var\u00a0formId\u00a0=\u00a0'8448b78f-8f42-454e-8e2a-f8196b0419af';\u00a0\/\/form\u00a0id<\/code><br \/>\n<code>var\u00a0entityName\u00a0=\u00a0\"account\";\u00a0\/\/entity\u00a0logical\u00a0name<\/code><br \/>\n<code>\/\/ Get the main form descriptor<\/code><br \/>\n<code>Xrm.Utility.getEntityMainFormDescriptor(entityName,\u00a0formId).then(function<\/code><br \/>\n<code>(response)\u00a0{<\/code><br \/>\n<code>var\u00a0entityFormSections\u00a0=\u00a0response.Sections;<\/code><br \/>\n<code>},\u00a0function(error)\u00a0{<\/code><br \/>\n<code>console.log(error.message);<\/code><br \/>\n<code>});<\/code><\/p>\n<p style=\"text-align: justify;\">Given below is the screenshot of the debugger where we get sections of the given entity form of the entity.<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/05\/1-Get-the-entity-form-details-using-Client-API.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-28026 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/05\/1-Get-the-entity-form-details-using-Client-API-e1622025425975.png\" alt=\"Get the entity form details using Client API\" width=\"1016\" height=\"386\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/05\/1-Get-the-entity-form-details-using-Client-API-e1622025425975.png 1016w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/05\/1-Get-the-entity-form-details-using-Client-API-e1622025425975-300x114.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/05\/1-Get-the-entity-form-details-using-Client-API-e1622025425975-768x292.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/05\/1-Get-the-entity-form-details-using-Client-API-e1622025425975-660x251.png 660w\" sizes=\"(max-width: 1016px) 100vw, 1016px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">Also, please find below the screenshot of the debugger where we get the \u2018Visible\u2019 property in each section. This helps to filter the visible sections of entity form.<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/05\/2-Get-the-entity-form-details-using-Client-API.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-28027 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/05\/2-Get-the-entity-form-details-using-Client-API-e1622025460458.png\" alt=\"Get the entity form details using Client API\" width=\"1004\" height=\"592\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/05\/2-Get-the-entity-form-details-using-Client-API-e1622025460458.png 1004w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/05\/2-Get-the-entity-form-details-using-Client-API-e1622025460458-300x177.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/05\/2-Get-the-entity-form-details-using-Client-API-e1622025460458-768x453.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/05\/2-Get-the-entity-form-details-using-Client-API-e1622025460458-660x389.png 660w\" sizes=\"(max-width: 1004px) 100vw, 1004px\" \/><\/a><\/p>\n<h2 style=\"text-align: justify;\"><strong>Conclusion<\/strong><\/h2>\n<p style=\"text-align: justify;\">In this way, with the help of Xrm.Utility.getEntityMainFormDescriptor Client API, we can easily get the entity form information.<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/product\/productivity-apps\/add-manage-schedule-notifications-alerts-4-dynamics-365-crm\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-28032 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/05\/A4D.jpg\" alt=\"Alert4dynamics\" width=\"800\" height=\"200\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/05\/A4D.jpg 800w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/05\/A4D-300x75.jpg 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/05\/A4D-768x192.jpg 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/05\/A4D-660x165.jpg 660w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">\n","protected":false},"excerpt":{"rendered":"<p>Introduction Normally, using Xrm.Utility.getEntityMainFormDescriptor Client API, we get the details of default main form of specified entity in the form of sections and attributes list. If we want to get the list of all the entity attributes or sections that is visible on an entity form, then we can use this Client API. In this\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.inogic.com\/blog\/2021\/05\/how-to-get-the-entity-form-details-using-xrm-utility-getentitymainformdescriptor-client-api\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[16,19],"tags":[2046],"class_list":["post-28017","post","type-post","status-publish","format-standard","hentry","category-dynamics-365","category-dynamics-crm","tag-client-api-in-dynamics-365-crm"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/28017","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=28017"}],"version-history":[{"count":0,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/28017\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media?parent=28017"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/categories?post=28017"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/tags?post=28017"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}