Violation of PRIMARY KEY constraint ‘PK_ModelElementData_ElementHandle’ with AX 2012R2 CU8

Apr 14, 2015 by Dick Wenning Category: AX2012 R2, DMF, Uncategorized, Upgrade 0 comments Tags: upgrade

Last week, I was upgrading AX 2012 R2 CU7 to CU8 and ran into a model store error. The error was similar to

It scared the hell out of me! First thing that came to mind was: is my model store corrupt in production?

But the source of the problem was indeed different; found out that the issue was label files.

In the AX 2012 R2 CU7, the DMF labels were missing, so this was fixed by adding them manually (see picture below)


This means that my AX2012 R2CU7 model store was consistent.

Label files cannot be deleted directly from the AOT. In such cases, the following workaround is necessary:

  1. Create a new model
  2. Move the labels to this new model
  3. Finally, delete this model

Leave a Comment!

Your email address will not be published. Required fields are marked *