Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Suggested answer

Problem with creating a sequence of numbers

(0) ShareShare
ReportReport
Posted on by 737

Hello,

I am trying to create a sequence of numbers. I am performing the steps according to: https://dynamics365musings.com/develop-a-d365-number-sequence/
After running the code, the sequence does not appear in the Number Sequences section in CustParameters. Am I doing something wrong?

Thanks.

class:

class AccountNumberGlobal extends NumberSeqModuleCustomer
{
    public void loadModule()
    {
        NumberSeqDatatype datatype = NumberSeqDatatype::construct();

        datatype.parmDatatypeId(extendedTypeNum(AccountGlobalId));
        datatype.parmReferenceHelp("Global account number");
        datatype.parmWizardIsContinuous(false);
        datatype.parmWizardIsManual(NoYes::No);
        datatype.parmWizardIsChangeDownAllowed(NoYes::Yes);
        datatype.parmWizardIsChangeUpAllowed(NoYes::Yes);
        datatype.parmWizardHighest(999999);
        datatype.parmSortField(60);
        this.create(datatype);
    }
}
      

job:

class testclass
{
    public static void main(Args _args)
    {
        AccountNumberGlobal ang = new AccountNumberGlobal();
        ang.loadModule();
    }

}

  • Suggested answer
    André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,969 Super User 2025 Season 1 on at
    RE: Problem with creating a sequence of numbers

    Hi Shooowtek,

    You can read my blog which explains what to do if the number sequence is not appearing on the number sequence tab in parameter forms.

    What to do when new number sequence references on parameter forms are missing? - Dynamicspedia

  • Shooowtek Profile Picture
    Shooowtek 737 on at
    RE: Problem with creating a sequence of numbers
    [quote user="GirishS"]

    I compare the code with the standard one. You seems to be missing one more line. Try adding that and check.

    Fullscreen
    1
    datatype.addParameterType(NumberSeqParameterType::DataArea, true, false);
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Thanks,

    Girish S.

    [/quote]

    still not working..

  • GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 on at
    RE: Problem with creating a sequence of numbers

    I compare the code with the standard one. You seems to be missing one more line. Try adding that and check.

    datatype.addParameterType(NumberSeqParameterType::DataArea, true, false);

    Thanks,

    Girish S.

  • Shooowtek Profile Picture
    Shooowtek 737 on at
    RE: Problem with creating a sequence of numbers
    [quote user="GirishS"]

    Have you checked the number sequence form ?

    Does the custom number sequence generating?

    Navigate to organization administration >>Number Sequence >> See whether custom number sequence is generated.

    Try running the runnable class again and add the debugger in load Module method of your custom number sequence class and see whether debugger is hitting.

    Thanks,

    Girish S.

    [/quote]

    After running the debugger, I can see that 'datatype' is 'no data selected'....

    Seq.png

  • GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 on at
    RE: Problem with creating a sequence of numbers

    Try rename the method to loadModule_Extension - Update the method name in runnable class and rerun them again.

    Thanks,

    Girish S.

  • Shooowtek Profile Picture
    Shooowtek 737 on at
    RE: Problem with creating a sequence of numbers
    [quote user="Komi Siabi"]

    Hi Shooowtek,

    On the number sequence wizard, did you see your new number sequence info log appear before you clicked the finish button?

    You might want to confirm that, you fully build your custom model, then run the job again, and regenerate.  

    [/quote]

    Hello Komi Siabi,

    1. No, I can't see my new number sequence.

    2. Yes, my model has been fully built.

    Where should the sequence be visible first - in the wizard or in the list in CustParamters? 

  • Suggested answer
    Komi Siabi Profile Picture
    Komi Siabi 12,759 Most Valuable Professional on at
    RE: Problem with creating a sequence of numbers

    Hi Shooowtek,

    On the number sequence wizard, did you see your new number sequence info log appear before you clicked the finish button?

    You might want to confirm that, you fully build your custom model, then run the job again, and regenerate.  

  • GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 on at
    RE: Problem with creating a sequence of numbers

    Have you checked the number sequence form ?

    Does the custom number sequence generating?

    Navigate to organization administration >>Number Sequence >> See whether custom number sequence is generated.

    Try running the runnable class again and add the debugger in load Module method of your custom number sequence class and see whether debugger is hitting.

    Thanks,

    Girish S.

  • Shooowtek Profile Picture
    Shooowtek 737 on at
    RE: Problem with creating a sequence of numbers

    Hello,

    Yes. I generated, I still can't see the sequence in the list..

    Is there anything else I should do?

  • Suggested answer
    GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 on at
    RE: Problem with creating a sequence of numbers

    Hi Shooowtek,

    After running the class have you generated the number sequence under Organization administration >> Number Sequence >> Generate.

    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

Announcing Our 2025 Season 1 Super Users!

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

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,969 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,842 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans