Use automatic numbers when a data item record needs to be numbered automatically with a unique value. For example, shipping invoices require a unique number be generated for each record. Once the initial automatic number has been defined, the system ensures each record has a unique, incremented value. Learn more in Automatic number configuration.
Optionally, you can apply automatic formats to automatic number on data items of type Text. Learn more in Automatic formats.
Company or org unit specific automatic numbers
Optionally, assign automatic numbers based on a Company or Org Unit. This allows automatic numbers to be assigned within a specific company in a table and removes gaps in the assigned numbers for records belonging to that company. Learn more in Dependent values for automatic numbers.
Automatic number caching
Optionally, use automatic number caching to have the system preload a group of automatic numbers into a cache before they are assigned to records. Automatic number caching can be turned on for:
- Individual automatic number definitions.
- All automatic number definitions assigned to a specific company or org unit.
- All automatic number definitions within an environment.
This feature can increase performance, but can also create gaps between numbers and cause records to have numbers assigned out of sequence. This is primarily used by system administrators during implementation.
Learn more in Automatic Number Definitions application and Automatic Number Cache Overrides application.
Automatic formats
Automatic formats are used to format automatic numbers of data items of type Text. Automatic numbers allow you to automatically increment a non-repeating, alphanumeric value assigned to a data item.
Automatic formats can include adding prefixes or suffixes, specifying upper or lowercase for text, or padding or truncating an automatic number.
For more information, see Automatic Number Definitions application and Automatic Format Definitions application.
Automatic Formats configuration
Use the Automatic Format Definitions and the Automatic Number Definitions applications to format a Text type automatic number.
Automatic formats
In the Automatic Format Parts subtable, specify what format you want to apply to the automatic number using the following fields:
- Org Unit Security Field
- Constant Value
- Passthrough Value
- Special Value
Additionally, you can refine the automatic format using any of the following parts:
- Choose
Current Timestampin Special Value to format the automatic number as a timestamp; choose the formatting for timestamp in Special Value Format. - Choose
Universally Unique IDin the Special Value part to use a UUID for the automatic number; use Special Value Format to specify how the UUID should be formatted. - Use Options to change the case of an automatic number or remove or trim whitespace from the number.
- Use Prefix or Suffix to add text to the beginning or end of an automatic number.
- Use Length to set the length for a specified part; if the length of the automatic number exceeds the set length of the part, the automatic number truncates.
- Use Pad Type to select a character to fill the automatic number field if the entry does not meet the required length of the field. Use Pad Side to specify which side of the automatic number field to apply the padding to. Use Length to specify the length of the padding applied to the automatic number.
Apply the automatic format to the automatic number definition
Open the Automatic Number Definitions application:
- On the Settings page, enter the name of the automatic format in Automatic Format Name and use Automatic Format Field to specify the location of the formatted automatic number.
- If you selected Passthrough Value as the ordered part for the automatic format in the Automatic Formats application, specify the Key and Value pair for the Passthrough Values in the Dynamic Data section.
Automatic Format Definitions application
Application developers use the Automatic Format Definitions application to format automatic numbers of Data Item Type Text.
To create an automatic format, you must use one or more ordered parts from the Automatic Format Parts subtable in the Automatic Format Definitions application. You can use a value, a passthrough, a predefined format (such as a timestamp), or other formatting including prefixes, suffixes, padding or truncating.
For more information about configuring automatic formats, see Automatic Formats configuration.
After you have configured the automatic format, use the Automatic Format Name field and the Automatic Format Field in the Automatic Number Definitions application to attach the format to the automatic number.
Dependent values for automatic numbers
When you create an automatic number definition for a data item, you might not want it to increment every time the data item is inserted or updated in a related table. You can use dependent values to control when an automatic number increments.
For example, an automatic number for data item Batch Job Number could increment each time a record is inserted into the related table. Instead, you might want the automatic number for data item Shipping Receipt to increment only with a specific combination of state or city values.
Use dependent fields and dependent values in the Automatic Number Definition application to set the combinations. For example, if there is an automatic number definition with a Dependent Field of State and a Dependent Value of Colorado, then the number only increments if the record has a dependent value of Colorado.
Org Unit/Company Field is a unique type of dependent field that only filters for the company field of a data item record. So, in the example above, if you add a Org Unit/Company Field of Distributor and a Org Unit/Company Value of Nextworld, then the record only increments if the fields of State and Distributor are Colorado and Nextworld.
Learn more about creating an automatic number definition in the Automatic Number Definitions application.
See Dependent values for automatic numbers configuration for information on how to configure dependent fields and values.
Dependent values for automatic numbers configuration
Use a dependent or company field and value combination to set conditions on when an automatic number increments. For example, if you Set dependent conditions in the Automatic Number Definitions application.
Set a dependent field and value
On the Settings page of the Automatic Number Definition application:
- Enter the name of the data item to be used for the dependent condition in the Dependent Field.
- Enter the value associated with the Dependent Field for the data item in the Dependent Value field . The automatic number only increments for an exact match of the term entered in the Dependent Value field.
While Dependent Field and Dependent Value are not required fields, if you enter a dependent value, you must also enter a dependent field for the data item.
You can use the Dependent Field Description to enter a reason for applying a dependent field to the automatic number definition.
Set a company field
Org Unit/Company Field and Org Unit/Company Value fields are unique dependent fields specific to a company. If incrementing the automatic number is dependent upon an Org Unit/Company Value, the table which the automatic number definition is built over must:
- Have the Org Unit, Company, or both fields added.
- Have the
Supports Sequence Groupingtable label. - Have the correct field label marking the lookup field as the desired Org Unit/Company field.
Automatic Number Definitions application
Application developers use the Automatic Number Definition applicationto configure data items with numeric values that need to increment automatically as records are created. This enables you to add automatic numbering within a field for a specific table.
The data item must have the Automatic Number checkbox selected in its configuration for it to reflect the automatic number setup in the Automatic Number Definitions application configuration.
For example, the data item ChargeID has the Automatic Number checkbox selected and an automatic number definition set up for that data item in the Charges table. This means that in the Customer Charges application, which is built over the Charges table, the field ChargeID would start the automatic numbering with the number preset in the automatic number definition and would increment by a predefined value every time a new record is saved.
These are the requirements to create a new automatic number definition:
- The data item must be part of the specified table.
- If dependent fields are used, they must be part of the table.
- If you configure dependent values, you must also configure the dependent fields.
- The data item definition must have the Automatic Number checkbox selected.
- If a new automatic number is being made in a non-base environment, either the data item or table for the automatic number must be in the same non-base environment.
Optionally, select the Cached Automatic Number checkbox to have the system preload a group of numbers into a cache before they are assigned to records. While this can improve performance, it also can cause gaps and out of sequence numbers. Learn more in Automatic numbers.
Automatic Number Values application
Application developers, testers, integrators, and system administrators can use the Automatic Number Values application to view and optionally edit the most recently incremented automatic number data item in a table.
An automatic number is attached to a data item in the Data Item Definitions application and is defined in the Automatic Number Definitions application. When a correctly configured automatic number is in use, the Automatic Number Values application maintains a record that shows the number most recently assigned to a record in the associated table. The automatic number value record is created automatically when the first record is saved to the table, and updated each time a new record is saved. The name of the automatic number value record is identical to the automatic number definition record name.
For more information, see Automatic Number Definitions application.
Change the next number in the sequence
The only field you can edit in the Automatic Number Values application is the Most Recent Number field. This field represents the automatic number that was last assigned to a record in the table defined for the automatic number definition. The next record created will be assigned the number that comes after the Most Recent Number in the sequence. If you change the value in this field, the next record inserted into the table will increment from the value you specified.
Keep in mind:
- With the exception of the Most Recent Number field, no other fields in the Automatic Number Values application are available for editing; they are meant to be used for reference purposes only.
- The value of the Most Recent Number field is initially populated based off the Initial Number field value in Automatic Number Definitions application, but can be changed at any time. For example, if you used a block of numbers while testing and then wanted to reset the most recent number to the last number used prior to testing, you would edit the number value in the Most Recent Number field.
- Changing the value of the Most Recent Number field impacts the next record created, which will use the next number in the sequence. Records already in the table are not changed.
- If you change the most recent number value to an earlier number in the sequence and a record already exists in the table with the subsequent number, you may receive an error when you attempt to create a new record. This depends on whether the automatic number data item is a unique index for the table.
Automatic number status
You can view the status of an automatic number in the Automatic Number Status field, which keeps track of the current state of the automatic number value. Only automatic value records that have a Not Used status can be deleted.
The automatic number status does not update automatically. To refresh the status, use the Update Link Status form button.
Automatic Number Cache Overrides application
System administrators use the Automatic Number Cache Override application while importing data during initial implementation. Automatic number caching enables the system to place a group of automatic numbers in a cache to improve performance.
You can create an automatic number cache override that is specific to a company or org unit, or have it applied to all automatic number definitions within an environment. When applied to an entire environment, the cache overrides the cache setting defined on individual automatic number definitions and any other environment automatic number settings.
Learn more in Automatic numbers.
Automatic numbers best practices
These best practices ensure that automatic numbers are configured consistently throughout Nextworld.
Automatic numbers are configured in the Data Item Definitions application. They must also be configured in the Automatic Definitions application after the data item has been created.
Use the the Automatic Number checkbox for fields that need a unique identifying number. Do not use a logic block to fetch the table and then take the the previous row's automatic number and just add 1 to it. Applying an automatic number avoids conflict because it ensures that the same number is not applied to two records.
Check the Locked field when configuring automatic number fields in the table configuration. This prevents the automatic number from being changed once a number has been assigned.
If you have an automatic number field in a table, you must add the automatic number field to the table's unique index.
Automatic number records have the option of specifying a Dependent Field field. If an automatic number contains a Dependent Field field, then those chosen fields should also be part of the unique index. If the chosen fields are not included in the unique index, then you receive a duplicate key error, which is an error stating that a record with the same unique key already exists.
Consider if the automatic number may be configured to use an automatic format, either by Nextworld or by a customer, or if the automatic number will only be a number.
If an automatic format is defined, all fields specified in the Automatic Format Definitions application must be fields in the table and must be of type text.
Naming conventions and standards
Automatic number names should have spaces and do not follow the UpperCamelCase convention that most Nextworld objects adhere to. Automatic number names should be descriptive enough for someone to know what the automatic number is for. It can be helpful to use the name of the data item you are setting the number up for. For example, Asset ID or Agreement Number are acceptable names for automatic numbers.