Configuring Document Numbering in Bitrix24
A manager creates a contract and writes the number by hand: "Contract #47." At the same time, another manager creates theirs—also "#47." A month later, accounting gets two contracts with the same number and different clients. Or another scenario: numbers are scattered—12, 15, 23, 8—because everyone numbers as they remember. Without automatic numbering, documents can't be properly maintained, found, or tracked.
Numbering Tasks
Proper numbering solves several issues:
- Uniqueness — each document has a unique number, no duplicates
- Order — numbers go sequentially, gaps are immediately visible
- Classification — the number tells you document type, year, direction
- Search — document found by number in seconds
Numbering Schemes
Bitrix24 supports flexible numbering through custom fields and business processes.
Simple sequential numbering:
001, 002, 003, ... — one counter for all documents. Good for small companies with one document type.
With document type prefix:
CONT-001, INV-001, ACT-001 — separate counter for each type. You see by number what kind of document it is.
With year:
CONT-2025-001 — counter resets January 1st each year. At new year start, numbering begins at 001.
With department or legal entity:
CONT-MSK-2025-001 — for companies with multiple branches or legal entities. Each branch maintains its own numbering.
Technical Implementation
Numbering is implemented through a business process that launches when a document is created (from template or smart process element).
Business process logic:
- Determine document type (from card field)
- Read current counter value from storage (custom field in a special reference list or global variable)
- Increment counter by 1
- Format number by template:
{Prefix}-{Year}-{Counter with leading zeros} - Write number to document field
- Save updated counter
To prevent duplicates with simultaneous document creation, a lock is used—the business process handles the queue sequentially.
Counter Reset by Year
At year start, the counter should begin at 1. This is done by checking in the business process: if the year in the counter doesn't match the current year—reset the value and update the year.
Alternatively—a scheduled business process that zeroes all counters on January 1st.
Manual Correction
Sometimes you need to set a number manually—for example, when migrating existing documents. For this:
- Field "Number (Manual)" — if filled, the business process uses it instead of auto-generation
- Ability to set counter start value—to continue numbering from a specific number
Application to Different Entities
Numbering works in:
- CRM document generator — number is substituted in .docx template via placeholder
- Smart processes — number is assigned to element on creation
- Lists — for internal documents: orders, memos, protocols
What We Configure
- Numbering scheme: number format, prefixes, digit width
- Business process for auto-numbering on document creation
- Separate counters by document type, legal entity, department
- Automatic counter reset at year start
- Manual number correction and counter start value option
- Integration with CRM document generator







