Skip to main content

Auto-Code Rules

Auto-code rules define how the platform automatically generates human-readable reference codes for entities. Instead of exposing raw UUIDs to users, entities like customers, orders, and applications get codes like CUS-00042 or ORD-A7K3M.

How it works

Each rule targets a specific field and defines the generation strategy. When a new record is created in an entity that has an auto-code rule, the platform generates a code according to the rule configuration.

Rule configuration

AttributePurpose
Target fieldThe field to populate (e.g. reference code, customer code)
PrefixOptional prefix string, up to 8 characters (e.g. CUS, ORD)
SeparatorSeparator between prefix and generated part (e.g. -)
LengthTotal length of the generated portion
Character setCharacter pool: ALPHA, ALPHANUMERIC, or NUMERIC
Generation typeGeneration strategy: SEQUENCE or RANDOM

Generation strategies

SEQUENCE — monotonically increasing numbers, zero-padded to the configured length. Produces predictable, sortable codes.

Example with prefix CUS, separator -, length 5, numeric:

CUS-00001, CUS-00002, CUS-00003, ...

RANDOM — random string from the chosen character set. Produces unpredictable codes suitable for external-facing identifiers.

Example with prefix LNK, separator -, length 6, alphanumeric:

LNK-A7K3M9, LNK-P2X8N4, LNK-R5B1Y6, ...

Scoping

Rules can be tenant-wide or scoped to a specific entity. A tenant-wide rule applies to all records of a given type, while a scoped rule only applies within the context of a specific entity — for example, different numbering sequences per organisation.

Only one rule can exist for a given field and scope combination.