web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Cannot create record. The Record already exists.

(0) ShareShare
ReportReport
Posted on by 145

I have a table that I created awhile ago that all of a sudden we cannot insert records into in our test environment.  When I try to insert a new record into this table I get the error message 'Cannot create a record in {Table Name}.  The record already exists.

I used SQL Profiler to trace the SQL statement being sent to the database and found out that it is trying to insert a record into the table with the same RecId as an existing record in the table.  I figured that this must be an issue in the SYSTEMSEQUENCES table so I went into the AOT to get the Id for the table.  I confirmed that I had the correct table Id by running this SQL statement:

SELECT *

FROM     SQLDICTIONARY

WHERE  NAME = '{Table Name}'

      AND FIELDID = 0

I then ran this SQL statement to see what the SYSTEMSEQUENCES table thinks should be the next RECID:

SELECT *

FROM   SYSTEMSEQUENCES

WHERE  TABID = {Table Id}

The weird thing is that the value that the SYSTEMSEQUENCES table says should be the next RECID is correct, however that is not the value that Dynamics AX is using when it tries to create a new record, it is using a value that has already been used.

Could somebody give me some suggestions on what might be wrong and how to fix it?  I did try restarting the server and deleting all of the AUC files on my local computer.

Thank You

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    André Arnaud de Calavon Profile Picture
    301,075 Super User 2025 Season 2 on at

    Hi Eric,

    Which version of AX are you using? In AX2012 there is a stored procedure used on the SQL database called 'sp_GetNextRecId'. If you are using AX2012, check if this one exists and the AOS user has execute permissions.

  • Eric Maibach Profile Picture
    145 on at

    I had been fighting with this for days.  I had tried rebooting the server, doing a full X++ and CIL compile and database sync, and tried rebooting the server.  However I still keep getting the issue.  Then all of a sudden this afternoon the issue went away.  I did not make any changes or do anything in between when it was not working and when it started working.

    So it is working now, but I am not sure what the issue was, or what made it start working.

  • Denis Macchinetti Profile Picture
    16,444 on at

    Hi Eric

    Could be an uncommitted record?

    Try to have a look at mybhat.blogspot.it/.../misleading-record-already-exists-message.html

    Also, how many AOS are active ?

    Recid are cached on AOS side.

    So, the AOS restart have fix the situation.

  • Dick Wenning Profile Picture
    8,705 Moderator on at

    what is the table caching of this table incase of entire table cach, you get same trouble.

    fix this way

    community.dynamics.com/.../109379.aspx

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans