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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Creating a Number Sequence for Newly Created Module

(0) ShareShare
ReportReport
Posted on by 4,009

Hi,
I've created a module(Course Management System) and added Parameter Table as well Parameter Form. I've also created a two EDTs(studentId,courseId) and added the module to map. I can see the Number Sequence on the Number Sequence form as well as references as StudentId and CourseId.
In the Parameter form I've the DataSource as Parameter and NumberSequenceReference and in the grid added (referenceLabel,NumberSequenceId). But, on running the form, I'm getting one entry as shown below.

Task1.PNG

Instead the expected entries are 

ReferenceLabel SequenceCode
student id <CMS ...>
courseid <CMS ...> 

Can anyone suggest any solution?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Martin Dráb Profile Picture
    239,451 Most Valuable Professional on at

    You must implement a class extending NumberSeqApplicationModule for your module. Look at existing NumberSeqModule* classes for examples.

  • Olister Rumao Profile Picture
    4,009 on at

    I've implemented the class as follows:

    class NumberSeqModuleCMS  extends NumberSeqApplicationModule

    {

       public void initializeReference(NumberSequenceReference _reference, NumberSeqDatatype _datatype, NumberSeqScope _scope)

       {

           super(_reference, _datatype, _scope);

           switch (_datatype.parmDatatypeId())

           {

               case extendedTypeNum(CMSStudentId):

               case extendedTypeNum(CMSCourseId):

           }

       }

       public void loadModule()

       {

           NumberSeqDatatype datatype = NumberSeqDatatype::construct();

           datatype.parmDatatypeId(extendedTypeNum(CMSStudentId));

           datatype.parmReferenceHelp(literalStr('Student ID'));

           datatype.parmWizardIsContinuous(false);

           datatype.parmWizardIsManual(NoYes::No);

           datatype.parmWizardIsChangeDownAllowed(NoYes::No);

           datatype.parmWizardIsChangeUpAllowed(NoYes::No);

           datatype.parmSortField(1);

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

           this.create(datatype);

          // NumberSeqDatatype datatype = NumberSeqDatatype::construct();

           datatype.parmDatatypeId(extendedTypeNum(CMSCourseId));

           datatype.parmReferenceHelp(literalStr('Course ID'));

           datatype.parmWizardIsContinuous(false);

           datatype.parmWizardIsManual(NoYes::No);

           datatype.parmWizardIsChangeDownAllowed(NoYes::No);

           datatype.parmWizardIsChangeUpAllowed(NoYes::No);

           datatype.parmSortField(2);

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

           this.create(datatype);

       }

       public NumberSeqModule numberSeqModule()

       {

           return NumberSeqModule::CMS;

       }

       [SubscribesTo(classStr(NumberSeqGlobal), delegateStr(NumberSeqGlobal, buildModulesMapDelegate))]

       public static void NumberSeqGlobal_buildModulesMapDelegate(Map numberSeqModuleNamesMap)

       {

           NumberSeqGlobal::addModuleToMap(classNum(NumberSeqModuleCMS),numberSeqModuleNamesMap);

       }

    }

    Also I've referenced this class in the form init() calling the via numberSeqPreInit() which contains the following code

    void numberSeqPreInit()

       {

           runExecuteDirect   = false;

           numberSequenceModules = [NumberSeqModule::CMS];

           numberSeqApplicationModule = new NumberSeqModuleCMS();

           scope = NumberSeqScopeFactory::createDataAreaScope();

           NumberSeqApplicationModule::createReferencesMulti(numberSequenceModules, scope);

       }

  • André Arnaud de Calavon Profile Picture
    304,729 Super User 2026 Season 1 on at

    Hi Olister,

    Did the reply from Martin help you? Or do you still have the open question. If so, please read the next blog for more help: community.dynamics.com/.../microsoft-dynamics-365-for-operations-number-sequence

  • Olister Rumao Profile Picture
    4,009 on at

    Hi André,

    I've already gone through that blog. And I can see the Reference in number sequence configuration. Also my number sequence is creating StudentId and Course ID on running 'info(NumberSeq::newGetNum(CMSParameters::numRefCMSCourseId()).num());' .I'm not able to display the reference in the number sequence tab.

  • Martin Dráb Profile Picture
    239,451 Most Valuable Professional on at

    Have used NumberSeqReference::buildQueryRunMulti() in executeQuery() of NumberSequenceReference datasource? You can find examples in (almost) any parameters form (and on internet).

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 39

#2
Michel ROY Profile Picture

Michel ROY 14

#3
imran ul haq Profile Picture

imran ul haq 8

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans