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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Small | Business Central, NAV, RMS
Answered

Accessing Number Sequences from x++

(0) ShareShare
ReportReport
Posted on by

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

    Hi Smore,

    I have open "Label search" from VS (Dynamics 365 menu -> Find labels...). Put "Billing rule" as search criteria and marked "Match exactly" option. In this case, there is only one label. I open a context menu on label id cell and choose "Find references". It will show you the list of objects where this label is used. Sometimes a label can be used in NumberSeqModule* directly or it can be assigned to EDT. If it's EDT you just continue search references for EDT.

  • Verified answer
    nmaenpaa Profile Picture
    Moderator on at

    Go to Classes\NumberSeqModuleProject\loadModule and find the entry where label is "Billing rule" (@PSA10946).

    Here it is:

                datatype.parmDatatypeId(extendedTypeNum(PSAContractLineNum));
                datatype.parmReferenceHelp(literalStr("@PSA10946"));
                datatype.parmWizardIsManual(NoYes::No);
                datatype.parmWizardfetchAheadQty(10);
                datatype.parmWizardIsChangeDownAllowed(NoYes::No);
                datatype.parmWizardIsChangeUpAllowed(NoYes::No);
                datatype.parmWizardLowest(1);
                datatype.parmWizardHighest(999999);
                datatype.parmSortField(30);
    
                datatype.addParameterType(NumberSeqParameterType::DataArea, true, false);
                this.create(datatype);

  • smore Profile Picture
    on at

    How were you able to determine that "Billing Rule" == PSAContractLineNum ?

  • Sergei Minozhenko Profile Picture
    on at

    Hi Smore,

    There is no numRef method for this type (EDT: PSAContractLineNum). If you need it, you can create your own.

    The number sequence table in parameter form builds on the information provided in NumberSeqModule* classes (in your case it's NumberSeqModuleProject), but not on the list of numRef* methods on table.

  • smore Profile Picture
    on at

    Here is a picture of the 27 ProjParamters:

    pastedimage1584651875490v1.png

    Here is a picture of 27 numRefs:

    pastedimage1584651975033v2.png

    Which numRef matches to the "Billing Rule" ?

  • Suggested answer
    nmaenpaa Profile Picture
    Moderator on at

    It's a method, not a field, so you need to add brackets.

  • Sergei Minozhenko Profile Picture
    on at

    Hi Smore,

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

  • smore Profile Picture
    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 ?

  • Verified answer
    Sergei Minozhenko Profile Picture
    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).

  • Suggested answer
    nmaenpaa Profile Picture
    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.

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 > Small | Business Central, NAV, RMS

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans