Nothing
*This post is locked for comments
Hello,
Here's a simple job that might help You find broken number sequences, afterwards You can correct them from database (just set the number as next free number sequence and the problem will go away).
static void mpl_systemSequences_tool(Args _args) { SystemSequences sysSeq; Common buffer; DictTable dt; str s1,s2; int iBad, iGood; while select crosscompany sysSeq where sysSeq.tabId != 100035 && sysSeq.tabId != 100036 { dt = new DictTable(sysSeq.tabId); if (dt) { buffer = dt.makeRecord(); select crossCompany maxOf(RecId) from buffer; s1 = int642str(buffer.RecId); s2 = int642str(sysSeq.nextVal); if (buffer.TableId == sysSeq.tabId && buffer.RecId < sysSeq.nextVal) { // info(strFmt("%1 %2 %3 %4",dt.id(),dt.name(),s1,s2));//buffer.RecId,sysSeq.nextVal)); iGood++; } else { warning(strFmt("%1 %2 %3 %4",dt.id(),dt.name(),buffer.RecId,sysSeq.nextVal)); iBad++; } } } info(strfmt("good: '%1' bad: '%2'",iGood,iBad)); }
Thank for your suggestion
Is that issue only with one number seuquence?
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156