web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :

How Preallocated Number Sequences are Cached in AX

JasonLar Profile Picture JasonLar 21

Number sequences handle automatic allocation of voucher numbers, invoice numbers, and journal numbers used by Microsoft Dynamics AX. You can set the allocation to be Continuous, or Preallocate a block of numbers. When using Continuous, gaps are not allowed, so a trip to the database is needed to get the next number.    When preallocating, a block of numbers are stored in memory, thus reducing the number of trips. This is important for the overall performance of the system; however, it is important to understand how these numbers are cached in a multi-user system.

Number sequences are stored on the client and not shared among user sessions, thus, each client/user session draws its own set of numbers. If the client/user session logs out, then a new set of numbers are pulled, but if they stayed logged in they will continue to use the first set of numbers that were allocated to that client/user session.   For example:

  1. Sales orders are set to preallocate by 10 and the next number is SO-00010
  2. User A launches a client session and attempts to create Sales orders
  3. The system preallocates 10 numbers in memory (SO-00010-SO-00019)
  4. User A creates three Sales orders and the system creates them as SO-00010, SO-00011, SO-00012
  5. User B launches a client session and attempts to create Sales orders
  6. The system preallocates 10 numbers in memory (SO-00020-SO-00029)
  7. User B creates one Sales order and the system creates this as SO-00020
  8. User A creates another Sales order and the system creates as SO-00013
  9. User A logs out of its client session
  10. User A launches a new client session and attempts to create Sales orders
  11. The system preallocates 10 numbers in memory (SO-00030-SO-00039)
  12. User A creates one Sales order and the sytem creates it as SO-00030

In most cases, using preallocated number sequences is good practice of less trips to the database, but if the risk of using too many number sequences is not a good trade off for increased performance then you should reconsider.  

Comments

*This post is locked for comments