{"id":800,"date":"2020-04-17T16:15:04","date_gmt":"2020-04-17T14:15:04","guid":{"rendered":"http:\/\/daxvisionerp.com\/?p=800"},"modified":"2025-10-22T15:05:59","modified_gmt":"2025-10-22T15:05:59","slug":"data-entity-errors","status":"publish","type":"post","link":"https:\/\/daxvisionerp.com\/home\/data-entity-errors\/","title":{"rendered":"Data entity errors"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Introduction<\/h2>\n\n\n\n<p>My previous article was <a href=\"http:\/\/daxvisionerp.com\/about-data-entities\/\">about data entities<\/a>.<br>After that, I started to put my knowledge into work and encountered some errors.<br>I didn&#8217;t find too much information about them so I decided to write a post about data entity errors.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Error after adding range<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Occurence<\/h3>\n\n\n\n<p>When I try to add a range to my data source, Visual Studio won\u2019t let me build the project. The following error message shows up:<br><em>A local variable named &#8216;IsPrimary&#8217; cannot be declared in this scope because it would give a different meaning to &#8216;IsPrimary&#8217;, which is already used in a parent or current scope to denote something else.<\/em><\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img decoding=\"async\" src=\"http:\/\/daxvisionerp.com\/wp-content\/uploads\/2020\/03\/image-5.png\" alt=\"\" class=\"wp-image-801\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Solution<\/h3>\n\n\n\n<p>The \u2018IsPrimary\u2019 field was one of the entity\u2019s fields. Renaming the range or the field did not solve the error.<br>Since it was a NoYes field, it was not mandatory to be in the entity field list because the range filtered the value already. I deleted the \u2018IsPrimary\u2019 field from the field list and now the project can be built without errors.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Errors after project rebuild<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Occurrence<\/h3>\n\n\n\n<p>After you modify an entity that\u2019s already been in the Data entity list \u2013 or in the DMFEntity table \u2013 and then you rebuild the project, you\u2019ll get something similar to the following error list.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img decoding=\"async\" src=\"http:\/\/daxvisionerp.com\/wp-content\/uploads\/2020\/03\/image-6.png\" alt=\"\" class=\"wp-image-802\"\/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li><em>Error at Dynamics.AX.Application.DmfDataPopulation.`syncEntityMetadata(StringCollection dataEntityViewCollection, StringCollection compositeEntityList) in xppSource:\/\/Source\/ApplicationFoundation\\AxClass_DmfDataPopulation.xpp:line 996.\u2019 on category \u2018Error\u2019.<\/em><\/li>\n\n\n\n<li><em>at Dynamics.AX.Application.DmfDataPopulation.syncEntityCreate(DictDataEntity dictDataEntity, Boolean useTargetEntityName)<\/em><\/li>\n\n\n\n<li><em> at Dynamics.AX.Application.DmfDataPopulation.syncEntityUpdate(DMFEntity _dmfEntity, DictDataEntity _dictDataEntity)<\/em><\/li>\n\n\n\n<li><em> Infolog diagnostic message: \u2018Cannot create a record in Entity (DMFEntity). Entity: Purchase Orders, Entity. <\/em><\/li>\n\n\n\n<li><em>Database synchronization failed. You may have to do a full build of the package \u2018Package\u2019 and all of its dependent packages. <\/em><\/li>\n\n\n\n<li><em>The record already exists.&#8217; on category &#8216;Error&#8217;.<\/em><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Solution<\/h3>\n\n\n\n<p>You can delete the affected entities from the Data Entities list. (System Administration \u2013 Data management node.) If the entity has corresponding data projects, delete them first. Then try deleting the entities again and rebuild the project.<br>This solution solves the errors only until the next rebuild.<br>The data entity&#8217;s label causes the real problem here. System data entities usually use the same label as their main data source&#8217;s label. Your data entity can easily get the same label if your entity was made with the help of the wizard.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Data entity not shown in Data entities list <\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Occurrence<\/h3>\n\n\n\n<p>Even after refreshing data entities, the custom data entity was still not shown in the list. However, it could be displayed by OData.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Solution<\/h3>\n\n\n\n<p>The custom entity had the same label as a system entity that already existed. I created a new different label for it and after that it was displayed in the data entities list.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Failed to parse data entity view queries for following data entities<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Occurrence<\/h3>\n\n\n\n<p>I imported a non-standard table from an old version of AX (AX 4.0) through xml. Then I created a data entity and used this table as one of the datasources. I didn&#8217;t get any errors when modifying properties and saving the object, but when I built and synchronized it, I got the following error list.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><em>Error\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 syncengine.exe exited with code -1.\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/em><\/li>\n\n\n\n<li><em>Error\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Microsoft.Dynamics.AX.Framework.Database.Synchronize.DataEntitySyncException: Failed to parse data entity view queries for following data entities<\/em>: &lt;EntityName><\/li>\n\n\n\n<li><em>Error\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 at Microsoft.Dynamics.AX.Framework.Database.Tools.SyncEngine.RunSync()\u00a0<\/em><\/li>\n\n\n\n<li><em>Error\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 at Microsoft.Dynamics.AX.Framework.Database.Tools.SyncEngine.Run(String metadataDirectory, String sqlConnectionString, SyncOptions options)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/em><\/li>\n\n\n\n<li><em>Error\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 at Microsoft.Dynamics.AX.Framework.Database.Tools.SyncEngine.FullSync()\u00a0\u00a0Error\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 at Microsoft.Dynamics.AX.Framework.Database.Tools.SyncEngine.DataEntityTriggerSync()<\/em><\/li>\n\n\n\n<li><em>Error\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 at Microsoft.Dynamics.AX.Framework.Database.Tools.DataEntityTriggerSync.RunSync()\u00a0<\/em><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Solution<\/h3>\n\n\n\n<p>After looking around on professional forums, I stumbled upon a <a href=\"https:\/\/community.dynamics.com\/365\/financeandoperations\/f\/dynamics-365-for-finance-and-operations-forum\/311369\/sync-error-failed-to-parse-data-entity-view-queries-for-following-data-entities\" target=\"_blank\" rel=\"noopener\">solution<\/a> that solved my issues. It suggested that this error might be caused because of table relations are not set up correctly and to check the cardinalities&nbsp;of the relations.<br>I noticed that on the table I imported, cardinality properties were not filled in. After filling them out correctly, the errors were gone and the data entity was working.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Summary<\/h2>\n\n\n\n<p>Fixing errors can be time consuming and sometimes frustrating. <br>I hope I could help you finding the solution that you were looking for.<\/p>\n\n\n\n<p><\/p>\n\n\n<div class=\"taxonomy-post_tag wp-block-post-terms\"><a href=\"https:\/\/daxvisionerp.com\/home\/tag\/msdyn365fo\/\" rel=\"tag\">#MSDyn365FO<\/a><span class=\"wp-block-post-terms__separator\">, <\/span><a href=\"https:\/\/daxvisionerp.com\/home\/tag\/data-entity\/\" rel=\"tag\">Data entity<\/a><\/div>","protected":false},"excerpt":{"rendered":"<p>Introduction My previous article was about data entities.After that, I started to put my knowledge into work and encountered some errors.I didn&#8217;t find too much information about them so I decided to write a post about data entity errors. Error after adding range Occurence When I try to add a range to my data source, [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"1080","footnotes":""},"categories":[19],"tags":[25,83],"class_list":["post-800","post","type-post","status-publish","format-standard","hentry","category-dynamics-365fo","tag-msdyn365fo","tag-data-entity"],"_links":{"self":[{"href":"https:\/\/daxvisionerp.com\/home\/wp-json\/wp\/v2\/posts\/800","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/daxvisionerp.com\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/daxvisionerp.com\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/daxvisionerp.com\/home\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/daxvisionerp.com\/home\/wp-json\/wp\/v2\/comments?post=800"}],"version-history":[{"count":1,"href":"https:\/\/daxvisionerp.com\/home\/wp-json\/wp\/v2\/posts\/800\/revisions"}],"predecessor-version":[{"id":1374,"href":"https:\/\/daxvisionerp.com\/home\/wp-json\/wp\/v2\/posts\/800\/revisions\/1374"}],"wp:attachment":[{"href":"https:\/\/daxvisionerp.com\/home\/wp-json\/wp\/v2\/media?parent=800"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/daxvisionerp.com\/home\/wp-json\/wp\/v2\/categories?post=800"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/daxvisionerp.com\/home\/wp-json\/wp\/v2\/tags?post=800"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}