{"id":11275,"date":"2018-02-28T18:05:23","date_gmt":"2018-02-28T12:35:23","guid":{"rendered":"https:\/\/www.inogic.com\/blog\/?p=11275"},"modified":"2021-05-14T09:02:44","modified_gmt":"2021-05-14T09:02:44","slug":"fixed-unable-to-create-or-update-record-after-upgrading-dynamics-365-crm","status":"publish","type":"post","link":"https:\/\/www.inogic.com\/blog\/2018\/02\/fixed-unable-to-create-or-update-record-after-upgrading-dynamics-365-crm\/","title":{"rendered":"Fixed &#8211; Unable to Create or Update record after Upgrading Dynamics 365 CRM"},"content":{"rendered":"<h2><strong>Introduction:<\/strong><\/h2>\n<p style=\"text-align: justify;\">Whenever we upgrade Dynamics CRM we learn many things along with it. Recently we had a business requirement where we recently upgraded Dynamics CRM from CRM 2011 to CRM 2016. We completed upgrade smoothly but after upgrading to CRM 2016 we were not able to Create\/Update the Service Activity record. While saving the record we were facing the error message.<\/p>\n<p style=\"text-align: justify;\">After downloading Error Log File, we found below error message.<\/p>\n<p style=\"text-align: justify;\">&lt;Message&gt; Both statecode and statuscode must be set or both of them must be null. &lt;\/Message&gt;<\/p>\n<p style=\"text-align: justify;\">The error messages show that Statecode and StatusCode fields must be filled or set NULL. But more often, we are not setting any values and as we know, CRM internal program sets the default value for these fields.<\/p>\n<p style=\"text-align: justify;\">So, we plotted this issue and found the root cause, .i.e. the \u201cstatecode\u201d field was entered in the form that was in the editable mode. And while saving the record this \u201cstatecode\u201d field was filling with a default value and converting its mode to \u201cdirty\u201d. Later on, it was passing in the save record context but on the other side \u201cstatuscode\u201d field was not getting passed. Hence, the above error message was getting displayed while saving the record.<\/p>\n<p style=\"text-align: justify;\">The absurd thing occurred is that after upgrading, the field was in editable mode but CRM generally doesn\u2019t allow to edit the \u201cstatecode\u201d field while saving the record.<\/p>\n<p style=\"text-align: justify;\">\u00a0You can see below screen that field was in editable mode:<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2018\/02\/1-Unable-to-Create-or-Update-record-after-Upgrading-Dynamics-365-CRM.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-27896\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2018\/02\/1-Unable-to-Create-or-Update-record-after-Upgrading-Dynamics-365-CRM.jpg\" alt=\"Unable to Create or Update record after Upgrading Dynamics 365 CRM (1)\" width=\"480\" height=\"129\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2018\/02\/1-Unable-to-Create-or-Update-record-after-Upgrading-Dynamics-365-CRM.jpg 480w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2018\/02\/1-Unable-to-Create-or-Update-record-after-Upgrading-Dynamics-365-CRM-300x81.jpg 300w\" sizes=\"(max-width: 480px) 100vw, 480px\" \/><\/a><\/p>\n<p>But when we saw the properties of the field, it is still showing in the lock mode.<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/05\/2-Unable-to-Create-or-Update-record-after-Upgrading-Dynamics-365-CRM.jpg\"><img decoding=\"async\" class=\"aligncenter wp-image-27894 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/05\/2-Unable-to-Create-or-Update-record-after-Upgrading-Dynamics-365-CRM.jpg\" alt=\"Unable to Create or Update record after Upgrading Dynamics 365 CRM\" width=\"319\" height=\"318\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/05\/2-Unable-to-Create-or-Update-record-after-Upgrading-Dynamics-365-CRM.jpg 319w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/05\/2-Unable-to-Create-or-Update-record-after-Upgrading-Dynamics-365-CRM-150x150.jpg 150w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/05\/2-Unable-to-Create-or-Update-record-after-Upgrading-Dynamics-365-CRM-300x300.jpg 300w\" sizes=\"(max-width: 319px) 100vw, 319px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">Then to fix the issue, we set the \u201cField\u201d to read-only mode using field properties from \u201cForm Editor\u201d.<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/05\/3-Unable-to-Create-or-Update-record-after-Upgrading-Dynamics-365-CRM.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-27895\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/05\/3-Unable-to-Create-or-Update-record-after-Upgrading-Dynamics-365-CRM.jpg\" alt=\"Unable to Create or Update record after Upgrading Dynamics 365 CRM\" width=\"313\" height=\"313\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/05\/3-Unable-to-Create-or-Update-record-after-Upgrading-Dynamics-365-CRM.jpg 313w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/05\/3-Unable-to-Create-or-Update-record-after-Upgrading-Dynamics-365-CRM-150x150.jpg 150w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/05\/3-Unable-to-Create-or-Update-record-after-Upgrading-Dynamics-365-CRM-300x300.jpg 300w\" sizes=\"(max-width: 313px) 100vw, 313px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">So, while saving the record, this field won\u2019t be dirty. And CRM Internal programs handles to update this field.<\/p>\n<h2 style=\"text-align: justify;\"><strong>Conclusion:<\/strong><\/h2>\n<p style=\"text-align: justify;\">Using the steps above user will be able to create or update records in Dynamics CRM after upgrading to newer version.<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/product\/integrations\/inolink-quickbooks-microsoft-dynamics-crm\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-10684\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2015\/08\/Microsoft-Dynamics-CRM-and-QuickBooks-Integration.png\" alt=\"Microsoft Dynamics CRM and QuickBooks Integration\" width=\"820\" height=\"205\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction: Whenever we upgrade Dynamics CRM we learn many things along with it. Recently we had a business requirement where we recently upgraded Dynamics CRM from CRM 2011 to CRM 2016. We completed upgrade smoothly but after upgrading to CRM 2016 we were not able to Create\/Update the Service Activity record. While saving the record\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.inogic.com\/blog\/2018\/02\/fixed-unable-to-create-or-update-record-after-upgrading-dynamics-365-crm\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":13,"featured_media":11276,"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,18,19],"tags":[1747,1763],"class_list":["post-11275","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dynamics-365","category-dynamics-365-v9-2","category-dynamics-crm","tag-unable-to-create-or-update-record","tag-upgrading-dynamics-365-crm"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/11275","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=11275"}],"version-history":[{"count":0,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/11275\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media\/11276"}],"wp:attachment":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media?parent=11275"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/categories?post=11275"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/tags?post=11275"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}