Coding Workshop: Auto-increment Attributes

|Time to read: 6 minutes

Coding Workshop: Auto-increment Attributes

What is auto-increment?

Auto-increment attributes are integral to various business processes, particularly those that involve the use of operational or financial documents. These attributes provide an automatic numbering mechanism which can be used in contexts such as Invoice numbers, PO numbers, and similar instances.

The simplest example of an auto-increment attribute is the numerical sequence 1, 2, 3 ...

Auto-increment attributes aren't limited to just numerical sequences. Key features of these attributes include:

Alphanumeric support: Apart from numbers, these attributes can also handle alphanumeric combinations, allowing for prefixes or codes.

Leading zeros: The attributes can be formatted to include leading zeros. To utilize this feature, specify the desired length for the auto-increment value.

Coding Workshop: Auto-increment Attributes

Understanding the Auto-Increment Mechanism

The auto-increment mechanism automatically assigns a unique value to a field, each time a new record is added. Here's a basic overview of how the mechanism works:

  1. When the auto-increment mechanism is first set up, an initial value is specified. This is the starting point from which the incrementing begins.
  2. The increment value is 1, meaning each new record will be incremented by 1 from the last record.
  3. Every time a new object is created, the auto-increment attribute is automatically populated with a value.
  4. The auto-increment mechanism ensures that each value is unique. This makes it ideal for numbering fields where each object must be uniquely identifiable.
  5. If an object with an auto-incremented value is deleted, that value will not be reused. The mechanism will continue incrementing from the last highest value.
  6. There might be a maximum limit up to which the auto-increment value can go, depending on the us of prefixes and the auto-increment length. Once this limit is reached, additional measures or adjustments might be necessary.

Auto-Increment Attributes in the App's Implementation Layer

The auto-increment field management module is located in the Implementation layer and is called Serial numbers.

Coding Workshop: Auto-increment Attributes

This tool serves several purposes:

  1. Setting an initial attribute value.
  2. Controlling the next value.
  3. Redefining the next attribute value if a prefix replacement is needed or if the numbering uniqueness is violated.
Coding Workshop: Auto-increment Attributes

The most common use case for this mechanism is undoubtedly setting the initial value. To set the initial value, click on the link of the next value.

Coding Workshop: Auto-increment Attributes
All articlesShare this post:

Every8.Cloud Product Tour Request

Let’s get started!

{{ vars.errorMessage }}
{{ vars.successMessage }}