VETtrak stores a unique internal identifier for each Client, Award, Invoice and Location. This internal identifier is stored in the VETtrak database and does not appear in the VETtrak user interface. These identifiers are designed to increment every time a new record of that type is created in VETtrak. This identifier can be amended to a higher number when using the Set next number option in the General Preferences - Autonumber section.
Autonumber Generation Logic
To describe this functionality we will use the autonumber generated in the Award Wizard as an example.
The Autonumber award options settings found under File - Global Preferences - General Preferences - Autonumber affect the way this number is generated:
The award auto-numbers are shared across award types of certificates, statements and other. This means that the internal identifier number sequences cannot be separated per award type by design.
When a new award is created the Auto number generated is the built using the below logic.
- Increment the internal award identifier
- Pad the internal identifier with leading zeros so the number is the length of the # of digits field
- Add the Prefix to the start of the number
VETtrak will also run checks on generated autonumber for records that may already have that same autonumber. An autonumber may already be in use if a user has manually entered a number that is above the existing internal identifier sequence. When the autonumber is being generated a check is performed to find if this value is already in use against another record for that record type. If a duplicate is found the autonumber will increment and repeat this check and increment process until the number is unique.
Please note: The above unique number check is not applied on invoice auto-numbers by design.
VETtrak will also run a check to see if the autonumber has been set to a higher number using the Set next number option in Global Preferences. If a higher number has been set VETtrak will save the internal identifier for that record to 1 number prior to the set number so that the next record created will match the set number.
For example, if the existing number in a sequence is 80 and you choose to amend the set number to 100 – this will then save the internal identifier to 99. The reason for this is that the next time a record is created, the increment of the internal identifier means that the record will move to the next number (100) and continue to follow your autonumber settings, resulting in an auto-number of 00100.