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 :
Microsoft Dynamics AX (Archived)

Creating a Number Sequence for Newly Created Module

(0) ShareShare
ReportReport
Posted on by 3,967

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
    237,880 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
    3,967 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
    301,030 Super User 2025 Season 2 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
    3,967 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
    237,880 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

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 > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans