Источник:
https://shashidotnet.wordpress.com/2...uences-update/
==============
If you ever get a error where the RecId being inserted into the table already exists then the SystemSequences table is to be blamed for this
In some of my previous blog posts, i update the system sequence table’s NextVal record, which determines the RecId to be given. However, this is tricky.
- Update in SQL
- Stop the AOS
- Update the NextVal recod in the SystemSequences Table
- Start the AOS
- Write a job
static void SetNextRecId(Args _args){ SystemSequences seq; ttsBegin; select firstonly forupdate crosscompany seq where seq.tabId == 123456; // use the table id here or tablenum() seq.skipTTSCheck(true); seq.skipDatabaseLog(true); seq.selectForUpdate(true); seq.nextVal = 5637123456 + 1; // enter the last recId for the table seq.update(); ttsCommit;}You may need to run this job and restart the AX client only if the just the above doesn’t work
static void sab_recIdSequenceFix(Args _args){ SystemSequence systemSequence = new systemSequence(); Tableid tableId = 123456; // use the table id or tablenum() here systemSequence.suspendRecIds(tableId); systemSequence.suspendTransIds(tableId); systemSequence.flushValues(tableId); systemSequence.removeRecIdSuspension(tableId); systemSequence.removeTransIdSuspension(tableId);}
Filed under:
Ax 2009,
Ax 2012,
Dynamics Ax,
X++ Tagged:
Ax 2009,
AX2012,
Dynamics Ax,
x++
Источник:
https://shashidotnet.wordpress.com/2...uences-update/