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

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

    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
    101,146 on at
    RE: Accessing Number Sequences from x++

    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
    90 on at
    RE: Accessing Number Sequences from x++

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

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

    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
    90 on at
    RE: Accessing Number Sequences from x++

    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
    101,146 on at
    RE: Accessing Number Sequences from x++

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

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

    Hi Smore,

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

  • 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 ?

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

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

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

Dynamics 365 Community Update – Sep 16th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

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

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

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

#1
Jahanvi Profile Picture

Jahanvi 34

#2
PJ JohnPaul Profile Picture

PJ JohnPaul 5

#3
SudhanshuMSID Profile Picture

SudhanshuMSID 1

Overall leaderboard

Product updates

Dynamics 365 release plans