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

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
    23,093 on at

    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,162 Moderator on at

    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

    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,162 Moderator on at

    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

    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,162 Moderator on at

    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,162 Moderator on at

    "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
    23,093 on at

    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

    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
    23,093 on at

    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

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
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 429 Most Valuable Professional

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans