Previously I had posted about how to create new NumberSequences in AX for both existing & new modules. I’ll share some important objects about NumberSequences.Number sequences handle the automatic allocation of ID numbers, vouchers, andjournal numbers.
A number sequence is created under
MAIN MENU->BASIC->SETUP->NUMBERSEQUENCES->NUMBER SEQUENCE.
From a developers point of view, these are the tables which are important.
• NumberSequenceTable contains the definitions of each number sequence.
• NumberSequenceList holds numbers for continuous number sequences that have not been completed or are currently reserved.
• NumberSequenceReference holds which number sequence is used for which function.
• NumberSequenceGroup is a list of number sequence groups.
• NumberSequenceGroupRef contains the number sequence references specific to a group.
• NumberSequenceTTS holds the transaction id of a number before it has been completely assigned. It is used during the clean up process, in case of a system crash.
• NumberSequenceHistory holds a log of all changes made to the number sequence.
From a developers point of view, these are the classes which are important.
• NumberSeq assigns numbers and vouchers, handles continuous number sequences, and calls clean up when appropriate.
• NumberSeq_Fast is used for number sequences that are not continuous. It does not keep a record of the status or store transaction ids for later clean up, and is better performance wise.
• NumberSeqCleanUp looks for numbers in the list that have not been completed, looks for the session that created them, and, if the session is no longer active, frees up the number for later use.
• NumberSeqDataArea is used in the clean up process.
• NumberSeqFormHandler is used whenever a number sequence assigns a number in a form. It handles records being deleted and ensures that two users cannot use the same number.
• NumberSeqReference creates the link between the function and the number sequence. NumberSeqReference is the super class used, and there is a sub class for each module.
• NumberSeqNumCache contains the method to manipulate the cache of reserved numbers.