Показать сообщение отдельно
Старый 12.07.2016, 18:12   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
stoneridgesoftware: Microsoft Dynamics AX Error: The Record Already Exists
Источник: https://stoneridgesoftware.com/micro...lready-exists/
==============

I was recently working on an issue in Dynamics AX where, after a code move we started receiving the error: ‘Cannot create a record in “TableName.” The record already exists.’

One of the most common reasons for this error is, one of the unique index fields has duplicated value. I verified all the unique index requirements were satisfied and there were no duplicated index values.

After investigating, I found out that the RecId generated by the system was getting a value that has been previously used.

The RecId sequence for tables is stored in SystemSequences table and can get out of sync due to one/more of the following reasons:

1.       Data is inserted in the SQL database directly

2.       There has been tableId conflicts during model store move

To fix this error, we need to reset the NextVal field in SystemSequences table. NextVal field should be set to a value greater than the max RecId of the table.

Steps to resolve the error ‘record already exists’:

1.       Get the tableId for the table.

a.       You can find the tableId from AOT, under Properties for the table.

syste

b.      You can run a job to display the tableId in infolog.



2.       Open SQL Server Management Studio and get the max value for RecId for the table, from SystemSequences table.

SELECT MAX(RecId) FROM 3.       Update the NextVal field to a value greater than the max RecId of the table.

UPDATE SystemSequences SET NextVal = + 1 WHERE TableId = 4.       Restart the AOS.



Источник: https://stoneridgesoftware.com/micro...lready-exists/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.