web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Reset Number Sequence

(0) ShareShare
ReportReport
Posted on by 854

Hi,

i have a test environment where users post many transactions in different modules. how can i reset related number sequences ?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    André Arnaud de Calavon Profile Picture
    304,551 Super User 2026 Season 1 on at

    Hi David,

    It is possible to clear the status list (if continuous) and then change the next value to represent the first value. You cannot change the in-use field manually from the user interface. It would be possible to change it using a script or table browser.

  • David Tailor Profile Picture
    854 on at

    Hi Andre,

    thanks for you reply. So after i run class to delete transactions, i have to manually clear status list for every related number sequence?

    By the way, class deletetrans doesn't clear all tables like pending vendor invoice (VendInvoiceinfotable). any idea?

    thanks.

  • Suggested answer
    Chaitanya Golla Profile Picture
    17,225 on at

    Hi,

    You can use following script to reset number sequence by passing the company name. Please test this code on your test environment before executing on actual.

    Source: http://techemall.blogspot.com/2015/09/reset-number-sequence-ax2012.html

    static void resetNumSeq(Args _args)
    {
        NumberSequenceTable numseqtab;
        info(curext());
        changecompany ('test') // Specify company name here
        {
            ttsbegin;
            while select forupdate numseqtab
            {
                numseqtab.NextRec = numseqtab.Lowest;
                numseqtab.update();
            }
            ttscommit;
        }
    }
  • André Arnaud de Calavon Profile Picture
    304,551 Super User 2026 Season 1 on at

    Hi David,

    There might be some updates for the delete transactions class, but not sure if this is also solved. If not, you can add your own tables to be included or excluded in the class.

    The code provided by Chaitanya might also help you. Note that this does not take into account if the number sequence is linked to transactions or master data. Without adjustments it will reset also number sequences from the global address book, customers, products, etc which you probably will not delete.

  • David Tailor Profile Picture
    854 on at

    Thanks Chaitanya and Andre,

    @Chaitanya, as per Andre it will reset all number sequence including those related to master data; is there any way to reset transactions related number sequence?

    @Andre, i should add my own tables to "handleNon Trans Table" within SysDatabaseTransDelete class?

  • Verified answer
    André Arnaud de Calavon Profile Picture
    304,551 Super User 2026 Season 1 on at

    Hi David,

    I don't remember the correct method name, but it could be indeed the one you mentioned.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 39

#2
Michel ROY Profile Picture

Michel ROY 14

#3
imran ul haq Profile Picture

imran ul haq 8

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans