Skip to main content

Notifications

Microsoft Dynamics AX (Archived)
Posted on by Microsoft Employee

Nothing

*This post is locked for comments

  • Suggested answer
    Maciej Krzysztofik Profile Picture
    Maciej Krzysztofik 290 on at
    RE: AX is picking up already used number sequence while creating transfer order on Dynamics AX 2012 R3 environment.

    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));
    
    }


  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: AX is picking up already used number sequence while creating transfer order on Dynamics AX 2012 R3 environment.

    Thank for your suggestion

  • Ajit Profile Picture
    Ajit 8,755 on at
    RE: AX is picking up already used number sequence while creating transfer order on Dynamics AX 2012 R3 environment.

    Is that issue only with one number seuquence?

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans