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)

Number Sequence Not Updating To Next Value

(0) ShareShare
ReportReport
Posted on by

Hi all,

  I am using this code in order to get the next value of the number sequence associated with the smmActivityNumber:

ns = NumberSeq::newGetNum(smmParameters::numRefActivityNumber());
ns.used();
smmActivityNumber = ns.num();

  This code is located inside a loop, so for every loop it should get the next number in the sequence.  Unfortunately, this is not the case and it is always getting the first number in the sequence (ABC-00000).

  As far as I know, the smmActivityNumber EDT comes out-of-the-box with Microsoft Dynamics AX 2012.  I loaded the modules through a job by using the class NumberSeqModuleGeneral and then went to Organization Administration --> Generate.

  However, the problem still persists.  How can I solve this  please?  Thanks

*This post is locked for comments

I have the same question (0)
  • Martin Dráb Profile Picture
    239,029 Most Valuable Professional on at

    Calling used() before allocating any number (num()) looks suspicious. Wouldn't swapping the calls make any difference?

  • Suggested answer
    Sohaib Cheema Profile Picture
    49,677 Super User 2026 Season 1 on at

    call it as under

    NumberSeq::newGetNum(CompanyInfo::numRefActivityNumber()).num();

    also remember its part of Basic while you navigate in Organizational administration >> Number sequences.

    This number sequence is being used at many places almost in all sort of activities wheher belonging to sales, projects or others

  • Community Member Profile Picture
    on at

    Hi Martin and Sohaib,

     I ommitted one important detail.  This happens only in my local environment.  On the DEV environment, it works perfectly.  So I think it is more related to setup rather than code.

    Thanks

  • Sohaib Cheema Profile Picture
    49,677 Super User 2026 Season 1 on at

    how you have done setup of number sequence in both systems? is that same w.r.t continuous checked or manual Unchecked?? have you seen this number sequence in Organization Administration for both environments?

  • Martin Dráb Profile Picture
    239,029 Most Valuable Professional on at

    So what's the setup?

  • Community Member Profile Picture
    on at

    To tell you the truth, the number sequences in both systems were not set up by me.  By any chance, do you know from where the smmActivityNumber number sequence can be set up please?  Thanks.

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

    Hi Anthony,

    The activity numbers can be setup on the Legal entity form per legal entity. (Organization administration > Setup > Organization > Legal entities.

    Check if the number sequence is set to continuous or not. If it is continuous in both environments, it is probably not due to the coding. Then check if the SQL database has all the needed stored procedures to be able to retrieve numbers.

    Check my blog for details on this stored procedure and how to create it when needed: kaya-consulting.com/solve-continuous-number-sequence-issue-in-ax-2012-r2

    PS when using the newGetNum() method without an optional additional parameter to make a decision later '_makeDecisionLater', the used() method is not needed.

  • Sohaib Cheema Profile Picture
    49,677 Super User 2026 Season 1 on at

    you can also run following job before running Wizard to setup sequence

    static void LoadNumSeqGenModule(Args _args)

    {

       NumberSeqModuleGeneral objNumberSeqModuleGeneral = new NumberSeqModuleGeneral();

       objNumberSeqModuleGeneral.load();

       info("Done");

    }

  • Community Member Profile Picture
    on at

    Thank you so much for your feedback Andre.  I will try it out and let you know if it worked.  Thanks again.

  • Community Member Profile Picture
    on at

    Hi Sohaib,

     I carried out this step to no avail.  I will try out Andre's suggestion and see if it works.  Thanks a lot.

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!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 2

#2
Henrik Nordlöf Profile Picture

Henrik Nordlöf 2 User Group Leader

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans