Working with numbersequences – New Module
In a previous post I explained how to create a new Number Sequence in a existing module (Working with numbersequences – new NumberSequence). In this post I will explain how you can create a new Number Sequence-module.
I will create a new module called TEST (lack of inspiration).
Step-By-Step:
- First of all extend the existing Enum ‘NumberSeqModule’ with a new value ‘TEST’ and enter the name of the module in the Label-property

- create a new class called ‘NumberSeqReference_TEST‘ and that extends from ‘NumberSeqReference‘.
- Add a static method called ‘numberSeqModule’ and return the new value of the Enum.
public static NumberSeqModule numberSeqModule() { return NumberSeqModule::TEST; }
- Override the Method loadModule and enter the necessary code for all the Number Sequences in your new module.
protected void loadModule() { NumberSequenceReference numRef; ; /* TEST */ numRef.DataTypeId = typeId2ExtendedTypeId(typeid(TEST)); numRef.ReferenceHelp = literalstr("@SYS31561"); numRef.WizardContinuous = false; numRef.WizardManual = NoYes::No; numRef.WizardAllowChangeDown = NoYes::No; numRef.WizardAllowChangeUp = NoYes::No; numRef.WizardHighest = 999999; numRef.SortField = 1; this.create(numRef); }
- In the class NumberSeqReference, you have to add some new lines so the system recognizes your new module. Complete the method construct & moduleList.


- Open the NumberSequence-form under BASIC – SETUP – NUMBER SEQUENCES – NUMBER SEQUENCES

- Open the Number Sequence-wizard

- Follow all the steps of the wizard and finish



- See how the new Number Sequence in the Number Sequence-form

From now on you can use your new Numbersequence and the module.
Tags: Ax 4.0, Ax 5.0 (2009), Data Types, Dynamics AX, Number Sequence, Programming, Tips & Tricks, X++
This entry was posted on Tuesday, February 16th, 2010 at 18:30 and is filed under Ax 3.0, Ax 4.0, Ax 5.0 (2009), Dynamics AX. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

