Add auto-numbering records in a table
- UpdatedAug 3, 2023
- 2 minutes to read
- Vancouver
- Platform Field Administration
You can define one number format per table in the system.
Before you begin
Procedure
- Navigate to All > System Definition > Number Maintenance.
- Click a table name to view the number record for that table, or click New.
- Define the number format by completing the fields (see table).
-
Click Submit or Update.
If an auto-numbered field does not already exist, a new field is automatically created on the table with the following values:
- Label: Number
- Name: u_number
- Default
value:
javascript:getNextObjNumberPadded();
Note: This script renumbers records when the Number of digits is updated. To use a script that does not renumber records when the Number of digits is updated, open the dictionary entry for the Number field and enter the following script in the Default value field.javascript:getNextObjNumber();
Table 1. Auto-numbering records in a table Field Description Table Select a table. Prefix Enter a prefix for every number in the table (for example, INC for Incident). Number Enter the base number for this table (default value is 1000). Record numbers are automatically incremented, and the next number is maintained in the Counter [sys_number_counter] table. If you set the base number to a value higher than the current counter, the next record number uses the new base number. Otherwise the next record number uses the current counter. The counter does not reset to a base number lower than itself. To see the current counter, click the Show Counter related link.
Number of digits Enter the minimum number of digits to use after the prefix (default value is 7). - Leading zeros are added to auto-numbers, if necessary. For example, INC0001001 contains three leading zeros.
- The number of digits can exceed the minimum length. For example, if Number of digits is 2 and more than 99 records are created on the table, the numbers continue past 100 (such as INC101).
Warning: Changing this field may update all number values for existing records on a table. Take care when changing this field on a production instance.Note:To change the default values for new number formats, change the Default value field on the system dictionary record for the Number or Number of digits field. These fields are on the Number table.
Related Content
- System dictionary
The system dictionary is a table, called Dictionary Entry [sys_dictionary], that contains details for each table and the definition for every column on each table in an instance.