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 :
Finance | Project Operations, Human Resources, ...
Answered

Get the existing Number Sequence on the Table

(0) ShareShare
ReportReport
Posted on by 20

HI, I had a problem on getting the existing or created number sequence in Dynamic 365. How to code it on X++??

I have the same question (1)
  • GirishS Profile Picture
    27,827 Moderator on at

    Hi,

    Your question is not clear. Can you elaborate more?

    Are you asking how to create number sequence from scratch?

    Thanks,

    Girish S.

  • Mohit Rampal Profile Picture
    12,565 Moderator on at

    Hi, As Girish mentioned, your query is not clear. Please provide more information on what you are trying to do (Preferrably with your code/screenshots)

  • Coders Profile Picture
    20 on at

    In the functional side, i created a number sequence in general ledger, after i created that i will used that on product creation. now, i want to get that number sequence using the X++ code. and put it on a variable.

  • Verified answer
    GirishS Profile Picture
    27,827 Moderator on at

    You can use NumberSeq class to get the number.

    You must know the EDT name related to number sequence.

    NumberSeq numSeq;
    
    ttsBegin;
    numSeq = NumberSeq::newGetNum(NumberSeqReference::findReference(extendedTypeNum(YourEdtName)));
    tableName.fieldName = numSeq.num();
    ttsCommit;

    Thanks,

    Girish S.

  • Coders Profile Picture
    20 on at

    I only get the one specific number sequence like ChemTest

  • GirishS Profile Picture
    27,827 Moderator on at

    I can't understand. What do you mean by "ChemTest"?

    Can you elaborate.

    Thanks,

    Girish S.

  • Coders Profile Picture
    20 on at

    pastedimage1678708193010v1.png i got this error

  • Coders Profile Picture
    20 on at

    the is the name of the number sequence i created

  • Suggested answer
    GirishS Profile Picture
    27,827 Moderator on at

    I think you missed some steps while creating custom number sequence.

    You need to load the number seqeunce class using runnable class.

    After that you need to go to Organization administration >> Number Sequence >> Number Sequence >> Generate (Button on the action pane).

    Refer to the below blog.

    https://community.dynamics.com/365/financeandoperations/b/nevoitechfinance/posts/custom-number-sequence-in-d365fo

    Thanks,

    Girish S.

  • GirishS Profile Picture
    27,827 Moderator on at

    Also, from the screenshot I can see that you are referring to "NumberSequenceCode" EDT which is a standard one.

    Are you creating number sequence for that EDT?

    Thanks,

    Girish S.

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 646 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 529 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 285 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans