Tutorial – Number Sequence Framework in AX 2012 R3 (New module)
Number sequences in Microsoft Dynamics AX are used to generate readable, unique identifiers for master data records and transaction records that require identifiers.
A master data record or transaction record that requires an identifier is referred to as a reference. Before you can create new records for a reference in Microsoft Dynamics AX, we must set up a number sequence and associate it with the reference. We use Organization administration to set up number sequences.
Purpose of Number Sequence:
The purpose of number sequence framework is to provide user-friendly, unique identifies while maintaining a continuous or non-continuous alpha numeric sequence.
A master data or transaction record that requires an identifier is referred to as a reference. Before we can create new records for a reference, we must set up a number sequence and associate it with the reference.
Main concept in Number Sequence
There are 2 main concept in Number sequence.
Scope: A scope is a valid combination of segments used for a specific transaction or master data entry. Company name will mentioned in scope.
Segment: A segment (also known as parameter) is a data entity such as legal entity, operating unit that can be used to define a number sequence format.
Flow chart: Number sequence
How to create number sequence in new module:
Step 01: Create a new menu.
AOT — Mneu
Then go to Menu – Main menu – New – menu reference.
Then it will open menus list.
Then select newly created menu (Test) and drag & drop in to
Now Test module is appeared in modules list.
AOT – Data Dictionary – Base Enums –NumberSeqModule .We need to add Newly created module (Test) in to it.
Note: Now we need to follow all standard procedure which we are followed in existing module for Number sequence.
Step 02: Create a new EDT. Label should be there.
Step 03: Create a new Table and add new field. EDT should be there.
Step 04: Create a new Parameter Table. Example (Test parameters)
Note : It is important that the functionality of number sequence references is copied exactly from one of the other parameter forms (for example, CustParameters). Remember to change the names of the called methods
and need to add new method :
Step 05: Create a new Parameter form
Step 06: Create a new number sequence class.
This class must extend the NumberSeqApplicationModule class.
Then add the numberSeqModule method to the new number sequence class.
This method must return the element for our module from the NumberSeqModule base enum.
The following code shows how this is done for the Test module.
and also add code in override LoadModule()
Step 07: Write a job and run
Then go to Test – Setup – Parameters – Test Parameters
In this parameter form segment ID is automatically added after this job.
Step 08: Run the wizard
Organization Administration >>CommonForms>>Numbersequences>>Numbersequences>> Generate >> run the wizard.
Step 9: Now we can check that number sequence is generated correctly or not
In above code instead of CustParameters we need to use TestParamaeters
Step 10: Setup number sequence in Form
Add methods in
Form : methods :
Form – Data source – methods :
Tables and Classes:
Number Sequence Table : It’s contains the definition of each number sequence.
Number Sequence List : It’s holds the numbers for the continuous number sequence..
Number Sequence Reference : It’s hold which number sequence is used for which function.
Number Sequence Group : It’s hold the list of Number sequence group.
Number Sequence Group Ref – It’s hold the number sequence reference for each group.
Number Sequence History : It’s hold the loss of all changes in number sequence.
Number Seq: The NumberSeq class provides continuous number sequences.
Number Seq Form Handler : The NumberSeqFormHandler class is a framework class that supports using number sequences by forms.
Number SeqGlobal : The NumberSeqGlobal class cleans up both committed and used numbers in addition to numbers that were not used.
Number SeqReference : It’s create link between the function and Number sequence.
Number Seq Data area : It’s used for clean up process.
Number Seqfast : It’s used for number sequence which is not continuous.
Number Seq Module Setup: The NumberSequenceModuleSetup class loads and fixes all of the static data that is needed for the NumberSequenceModule framework.
Author Bio: This tutorial is shared by Microsoft Dynamics AX Company to explain the work of Number Sequence Framework in AX 2012 R3. There are total 10 steps that you need to follow to accomplish the project. Happy Coding.