Generate unique document numbers automatically
Let's do a quick check on our requirement list:
To have a record automatically generate a unique number, we will use the existing Dynamics NAV functionality called number series (shortened to No. Series in Dynamics NAV). The purpose of the number series functionality is to allow the system to keep track of a unique number for you and save the number used in a table. This function is typically used for primary key fields, as we will use with our application.
For example, if we set our sales invoice number series to start from INV-100000, Dynamics NAV will automatically increment INV-100000 by one numeric digit when we call this function. In this case, the next value to be given will be INV-100001.
If you want to learn more about the number series function in Dynamics NAV, you can read about it here:
http://msdn.microsoft.com/en-us/library/hh879485(v=nav.70).aspx