{"id":3802,"date":"2016-11-02T19:28:12","date_gmt":"2016-11-02T13:58:12","guid":{"rendered":"https:\/\/www.inogic.com\/blog\/?p=3802"},"modified":"2016-11-02T19:28:12","modified_gmt":"2016-11-02T13:58:12","slug":"found-an-integer-attribute-with-unrecognized-format-new_customeridtype-solved","status":"publish","type":"post","link":"https:\/\/www.inogic.com\/blog\/2016\/11\/found-an-integer-attribute-with-unrecognized-format-new_customeridtype-solved\/","title":{"rendered":"Found an integer attribute with unrecognized format: new_customeridtype \u2013 Solved"},"content":{"rendered":"<p><strong>Introduction:<\/strong><\/p>\n<p>Microsoft introduced the customer type field in Dynamics CRM 2016. To know more about it, you can refer this <a href=\"https:\/\/www.inogic.com\/blog\/2016\/06\/commencement-of-customer-type-field-in-dynamics-crm-2016-update-1\" target=\"_blank\" rel=\"noopener noreferrer\">blog<\/a> to explore it more. In this blog, we will focus on one of the error, which is caused while retrieving entity metadata for customer field.<\/p>\n<p><strong>Problem:<\/strong><\/p>\n<p>In one of our examples, our requirement was to read the metadata of entity. For this, we tried to retrieve entity metadata using RetrieveEntityRequest.<\/p>\n<p>Following is the code snippet:<\/p>\n<pre class=\"lang:default decode:true\">\/\/Retreive the entity request\n                RetrieveEntityRequest attreq = new RetrieveEntityRequest();\n                \/\/retrieve all data for an entity\n                attreq.EntityFilters = EntityFilters.All;\n                \/\/set the custom entity logical Name\n                attreq.LogicalName = \"new_employee\";\n                \/\/Set this value to true to include unpublished changes, as it would look if you called publish\n                attreq.RetrieveAsIfPublished = true;\n                \/\/Response the request RetreiveEntityRequest\n                RetrieveEntityResponse attResponse = (RetrieveEntityResponse)_service.Execute(attreq);\n<\/pre>\n<p>While execution, it was\u00a0throwing the error \u201cFound an integer attribute with unrecognized format: new_customeridtype\u201d.<\/p>\n<p><strong>Cause:<\/strong><\/p>\n<p>RetrieveAsIfPublished = &#8220;True&#8221; means return the metadata(Entity, Attributes, Relationship, Optionset, option) including unpublished changes.<\/p>\n<p>RetrieveAsIfPublished = \u201cFalse\u201d means return only the currently published Metadata, ignoring any unpublished changes.<\/p>\n<p>In order to overcome with this issue, we set entity request \u201cRetreiveAsIfPublished\u201d property to false.<\/p>\n<p><strong>Solution:<\/strong><\/p>\n<p>So we used the revised code as below:<\/p>\n<pre class=\"lang:default decode:true \">\/\/Retreive the entity request\n                RetrieveEntityRequest attreq = new RetrieveEntityRequest();\n                \/\/retrieve all data for an entity\n                attreq.EntityFilters = EntityFilters.All;\n                \/\/set the custom entity logical Name\n                attreq.LogicalName = \"new_employee\";\n                \/\/Set RetrieveAsIfPublished value to false ignoring the unpublished changes\n                attreq.RetrieveAsIfPublished = false;\n                \/\/Response the request RetreiveEntityRequest\n                RetrieveEntityResponse attResponse = (RetrieveEntityResponse)_service.Execute(attreq);\n<\/pre>\n<p>And, we were able to get the results without any error.<\/p>\n<p>Hope this helps you.<\/p>\n<p>Get hands on experience\u00a0of<a href=\"http:\/\/www.inogic.com\/product\/integrations\/maplytics-bing-map-microsoft-dynamics-crm\" target=\"_blank\" rel=\"noopener noreferrer\">\u00a0Maplytics \u2013 Dynamics CRM + Maps<\/a>\u00a0and navigate with style!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction: Microsoft introduced the customer type field in Dynamics CRM 2016. To know more about it, you can refer this blog to explore it more. In this blog, we will focus on one of the error, which is caused while retrieving entity metadata for customer field. Problem: In one of our examples, our requirement was\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.inogic.com\/blog\/2016\/11\/found-an-integer-attribute-with-unrecognized-format-new_customeridtype-solved\/\">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":[15,16,19,24],"tags":[619,833,1471,1472],"class_list":["post-3802","post","type-post","status-publish","format-standard","hentry","category-development","category-dynamics-365","category-dynamics-crm","category-dynamics-crm-2016","tag-dynamics-crm-customer-field-error","tag-found-an-integer-attribute-with-unrecognized-format-error","tag-retrieveentityrequest-error-in-customer-field","tag-retrieveentityrequest-error-in-dynamics-crm-2016-customer-field"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/3802","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=3802"}],"version-history":[{"count":0,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/3802\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media?parent=3802"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/categories?post=3802"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/tags?post=3802"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}