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
- I came across the following post: http://blog.daxteam.net/2016/06/fix-recid.html
- the Job i use now is:
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;
}
Filed under: Ax 2009, Ax 2012, Dynamics Ax, X++ Tagged: Ax 2009, AX2012, Dynamics Ax, x++

Like
Report
*This post is locked for comments