Number series in Axapta


Hi All,

The number sequence is controlled by class NumberSeq (for
continuous-type number sequence), and class NumberSeq_Fast (for
non-continuous-type number sequence). I believe your problem is mostly
related to the continuous one, since you mentioned the clean-up
process.
In continuous-type, whenever the user create a new line of transaction
with new number (say 'GJ-001'), one record in table NumberSequenceList
will be inserted, stating that 'GJ-001' is being used (status
'Active'). If the user cancels the line before saving it, the record
status in NumberSequenceList will be set to 'Free'. However if the
user saves the line (or even deletes the line after saving it first),
the record in NumberSequenceList will be removed. When generate a new
continuous number, the system will first lookup for the 'free' number
in table NumberSequenceList. If found, the free one will be used. If
not, the next number is used (and the counter is increased).

General journal form (in GL module, form LedgerJournalTable) had
number sequence conflict issue when AX 3.0 was first released. In that
old form, users can create new record more than one (sequentially at
once) and leave the other records unsaved:

Journal num
===========
*GJ-008    (not yet saved in form, listed in NumberSequenceList as 'Active')
*GJ-007    (not yet saved in form, listed in NumberSequenceList as 'Active')
*GJ-006    (not yet saved in form, listed in NumberSequenceList as 'Active')
GJ-0005    (saved)
GJ-0004    (saved)

The user then saves only GJ-006, and close the form. Unfortunately,
the system wrongly recognizes GJ-008 (the last one) as the one which
should be freed from the list, thus the numbers listed are:

GJ-007, listed in NumberSequenceList as 'Active'
GJ-006, listed in NumberSequenceList as 'Active' (wrong, should be 'Free)

The user then logout. In the next login (new session), the clean-up
process is run. This process recognizes that GJ-007 and GJ-006 were
both 'Active' but in the old session which has been terminated (old
session/dead session). Thus it decides to make them all 'Free' in this
new session, because it must have not been used/committed in the old
session. The numbers listed become:

GJ-007, listed in NumberSequenceList as 'Free'
GJ-006, listed in NumberSequenceList as 'Free'

The user then use General Journal form, and create a new journal
record. The new journal number assigned will be GJ-006, taken from
NumberSequenceList. But the problem is, GJ-006 has been previously
used as journal number, thus the number sequence conflict has occured:
"The record already exists".

Later on this error was resolved by Microsoft through SP release, by
avoiding multi-new-record creation before the last one is saved. So,
sometimes error in number sequence comes from the way the form is
programmed. If you find such kind of error, you can try to delete the
conflicting number sequence from the list: Menu Basic -> Setup ->
Number sequences -> form Number Sequences -> button List.

Hope this helps.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.