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

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Accessing Number Sequences from x++

(0) ShareShare
ReportReport
Posted on by 90

I have seen multiple examples like:

SalesParameters::numRefSalesId()
CustParameters::numRefCustAccount()
HrmParameters::numRefJournalNum()

But how can I convert a name in the UI into x++ ?

What is the Parameter for <Tes_100 ?

What is the Parameter for <Tes_105 ?

pastedimage1583946332077v1.png

I have the same question (0)
  • Sergei Minozhenko Profile Picture
    on at
    RE: Accessing Number Sequences from x++

    Hi Smore,

    Do you want to understand how number sequence <Tes_100 or <Tes_105 used in the system?

  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at
    RE: Accessing Number Sequences from x++

    It depends on how you set up your parameters. If you have set up SalesParameters in a way that <Tes_105 is used as Sales order number, then SalesParameters::numRefSalesId() would return that sequence.

    If you haven't used this sequence in any parameters, you of course can't get it via any parameter.

    So, in Number sequences form you define the number sequences. In the parameters forms you define what number sequence is used for specific purpose, such as Sales order number.

    Is it now clear?

  • smore Profile Picture
    90 on at
    RE: Accessing Number Sequences from x++

    Not 100%.

    Here is the Sales parameters UI:

    pastedimage1583950087260v1.png

    I don't see numRefSalesId in the UI....

    How do I match up the Reference in the UI "Relation journal ID" into an x++ numRefXXXX ?

  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at
    RE: Accessing Number Sequences from x++

    You are looking at Sales and Marketing parameters but actually SalesParameters table is Accounts Receivable parameters in the UI.

  • smore Profile Picture
    90 on at
    RE: Accessing Number Sequences from x++

    How is one supposed to know that ?

    I am really trying to figure out the "Project budget ID". By learning how all these things connect I was hoping the find the correct answer myself.

  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at
    RE: Accessing Number Sequences from x++

    And how to match these things, look at NumberSeqModule* classes. In LoadModule you see the extended data types that are used in parameters of each module.

    docs.microsoft.com/.../number-sequence-framework

  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at
    RE: Accessing Number Sequences from x++

    "How is one supposed to know that ?"

    Look at label of SalesParameters table.

    Anyway many things in D365FO are not easy to figure out when you do it for the first time. Having a mentor, and being good at web searches are important.

  • Verified answer
    Sergei Minozhenko Profile Picture
    on at
    RE: Accessing Number Sequences from x++

    Hi Smore,

    Usually, all number sequences are linked to certain EDT. If you want to find number sequence and related method (if it exists) you need

    1. Identify EDT (in case of "Project budget ID" it's ProjBudgetId)

    2. Find EDT in AOT

    3. Find EDT references and look for numRef* method and NumberSeqModule classes (it will help you identify function module where number sequence is used).

  • smore Profile Picture
    90 on at
    RE: Accessing Number Sequences from x++

    When using the editor, it looks like my choice is valid:

    pastedimage1583953826877v1.png

    But when I compile, I get the following error:

    pastedimage1583953915153v2.png

    If ProjParameters does not have that field, then why is the IDE showing that as a valid option ?

  • Sergei Minozhenko Profile Picture
    on at
    RE: Accessing Number Sequences from x++

    Hi Smore,

    You probably forgot to add brackets ( ProjParameters::numRefProjBudgetId() )

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

Mansi Soni – Community Spotlight

We are honored to recognize Mansi Soni as our August 2025 Community…

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans