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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Reset Number Sequence

(0) ShareShare
ReportReport
Posted on by 822

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
    301,020 Super User 2025 Season 2 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
    822 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
    301,020 Super User 2025 Season 2 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
    822 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
    301,020 Super User 2025 Season 2 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
Ali Zaidi Profile Picture

Ali Zaidi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans