AutoNumber fields are fields that 'automatically increment'; i.e. they are automatically assigned a number when a new record is created and the number increases by 1 for each new record. This means they can be used to create an identity column which uniquely identifies each record in a report.
AutoNumber fields also support number patterns with 'zero-padding' as well as prefixes and suffixes; this is useful for generating employee IDs, Invoices, etc. The image below shows a Student ID that is generated using an AutoNumber field.
Supported Patterns for AutoNumbers
AutoNumbers can be prefixed (INV: 00001) or suffixed (000001-X), or both (INV: 00001-X) using 'patterns'. These patterns have the following rules:
- can be left blank (default) - output will be a number
- can be a string of zeros - output will use leading zeros as padding
- can be a single '#' - output will be a number
- prefixes and suffixes must be accompanied by either one or more '0's, or a '#'
- to include a '#' or '-' in the output the character must be escaped using a '\'
- there can only be 1 number group in a pattern
- prefixes and suffixes may contain characters 'a' through to 'Z', spaces, colons
- prefixes and suffixes may NOT contain any number [0-9]
AutoNumber Properties
AutoNumber fields can also specify a 'starting number', note that the starting number can not be changed once it has been set. In contrast the pattern can be changed at any time. The AutoNumber field properties is shown in the image below:
Points to note about AutoNumber Fields
AutoNumber fields:
- are read-only
- do NOT have Form Detail or Custom Form Validation tabs
- can specify a starting number, default = 1 (can not be changed after being set)
- support pattern formatting, e.g.: INV-0001, ID-0001-X
- can be setup as Resource Keys
Note: for general information about field properties refer to General Field Properties.