Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Possible problem with model store.

(0) ShareShare
ReportReport
Posted on by 4,020

I am having a problem with deleting elements in my usr layer.

As an example i have a class names PCImportAttributeDefaultValueHandler, it exists in syp and usr, though if i do a compare there are no differences.

Not if i try to delete the class, i get this error.

Error Message (14:35:01) Cannot execute a stored procedure.
The SQL database has issued an error.
Info Message (14:35:01) SQL error description: [Microsoft][SQL Server Native Client 11.0][SQL Server]The INSERT statement conflicted with the FOREIGN KEY constraint "FK_ModelElementData_HasModelId_LayerId". The conflict occurred in database "Axapta60_0R3_model", table "dbo.Model".
Info Message (14:35:01) SQL statement: { CALL [Axapta60_0R3_model].[dbo].[XU_Insert](?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) }

Any idea what is wrong?

*This post is locked for comments

  • Rudi Hansen Profile Picture
    Rudi Hansen 4,020 on at
    RE: Possible problem with model store.

    That also gives me the same error, I have given up and am simply doing a reinstall.

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 292,187 Super User 2025 Season 1 on at
    RE: Possible problem with model store.

    Hi Rudi,

    Can you try to move the object to a new USR layer model and then delete the model (and so also this object)?

  • Rudi Hansen Profile Picture
    Rudi Hansen 4,020 on at
    RE: Possible problem with model store.

    Well this is a test system, so did not make a backup.

    I will just reinstall it if we can't fix it easy.

    Now i tried to make a change to the class, but then i also get the same error.

  • Suggested answer
    Iulian Cordobin Profile Picture
    Iulian Cordobin 8,201 on at
    RE: Possible problem with model store.

    You can get in these situations from time to time. I haven't been able to identify how one gets here, and the fix can be different depending on the particular scenario. Sometime, the model db can get quite badly corrupted and it may need a restore from a previous error free backup. If you don't have one, or is too old, you can try to fix these manually.

    Of course, always backup your model db before starting to look in the model db.

    In your case, I would try for instance, to recreate a new change on the USR layer on that object, restart the AOS, and try to delete the object. If this doesn't work, there are other options we can try.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,187 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,966 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans