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
| Attribute | Purpose |
|---|---|
| Target field | The field to populate (e.g. reference code, customer code) |
| Prefix | Optional prefix string, up to 8 characters (e.g. CUS, ORD) |
| Separator | Separator between prefix and generated part (e.g. -) |
| Length | Total length of the generated portion |
| Character set | Character pool: ALPHA, ALPHANUMERIC, or NUMERIC |
| Generation type | Generation 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.