Automatic Document Numbering in Bitrix24
A manager creates a contract and manually enters the number: "Contract No. 47". Another manager simultaneously creates theirs — also "No. 47". A month later, the accounting department receives two contracts with the same number but different counterparties. Or another scenario: numbers are out of order — 12, 15, 23, 8 — because everyone numbers as they remember. Without automatic numbering, documents cannot be properly managed, searched, or accounted for. Manual entry takes up to two minutes per document, and with a flow of 50 documents per day, that's an hour and a half of lost time. Automation assigns a number in two seconds — 10 times faster. We will set up numbering turnkey in 2–3 days. Write to us — we'll evaluate your project.
What Problems Does Automatic Numbering Solve?
A proper numbering system eliminates routine and errors:
- Uniqueness — each document gets a unique number, duplicates are impossible even when multiple employees work simultaneously.
- Order — numbers are strictly sequential, gaps are immediately noticeable.
- Classification — the number easily identifies the document type, year, or branch.
- Search speed — a document is found by number in seconds, search time reduced by 80%.
Numbering Schemes: Comparison of Options
| Scheme | Example | When it fits | Advantage |
|---|---|---|---|
| Sequential | 001, 002, 003 | Small business, single document type | Simple implementation |
| With type prefix | CON-001, INV-001 | Companies with different document types | Visual type identification |
| With year | CON-{Year}-001 | Official documents, accounting | Auto-reset counter each year |
| With department | CON-MSK-{Year}-001 | Branches, multiple legal entities | Separate numbering by department |
Automatic numbering reduces document search time by 80% and completely eliminates duplicates. We use flexible schemes through custom fields and business processes.
Technical Implementation: From Counter to Locking
Numbering is implemented through a business process that runs when a document is created (generated from a template or when a smart process item is created).
Business process logic:
- Determine the document type (from the card field)
- Read the current counter value from storage (custom field in a special reference list or global variable)
- Increment the counter by 1
- Form the number according to the template:
{Prefix}-{Year}-{Counter with leading zeros} - Write the number to the document field
- Save the updated counter
To protect against duplicates when documents are created simultaneously, locking is used — the business process processes the queue sequentially. According to Bitrix24 documentation, this is the standard approach. More on business processes.
Why Does Numbering Break During Simultaneous Creation?
The reason is a race condition, when two managers save documents almost simultaneously. A business process without locking may read the same counter value and assign the same number. The solution is sequential processing through database locks or using transactions. In our practice, this problem occurs in 15% of projects when migrating from manual numbering.
Implementation Methods: Business Process vs Custom Solution
| Criterion | Business Process | Custom Application |
|---|---|---|
| Implementation speed | 1–2 days | 3–5 days |
| Configuration flexibility | High (via interface) | Maximum |
| Maintenance requirements | Low | High (developer needed) |
| Risk of errors under load | Minimal (has locks) | Depends on implementation |
A business process is suitable for 90% of tasks. A custom solution is justified for non-standard rules or high load (more than 1000 documents per day).
Counter Reset by Year
At the beginning of a new year, the counter should start from 1. This is implemented by checking in the business process: if the year in the counter does not match the current year — reset the value and update the year. An alternative is a scheduled business process that zeroes all counters at the beginning of the year.
How to Transfer Existing Numbering?
Sometimes a number needs to be entered manually — for example, when migrating existing documents. For this, we provide:
- "Number (manual)" field — if filled, the business process uses it instead of auto-generation.
- Ability to set a starting counter value — to continue numbering from the desired number.
What Is Included in Numbering Setup
We provide a complete set of work:
- Development of a numbering scheme according to your business processes.
- Configuration of the auto-numbering business process with locks.
- Creation of separate counters for document types, legal entities, departments.
- Automatic counter reset at the beginning of the year.
- Setup of manual correction and starting value.
- Integration with the CRM document generator.
- Documentation of the scheme and access to settings.
- Employee training (1 hour online).
Typical Mistakes When Setting Up Numbering
- Ignoring locking under high load — leads to duplicates.
- Lack of counter backup — numbers may be lost during a failure.
- Using complex templates with many prefixes without considering field length.
Our experience: over 5 years configuring Bitrix24 for 150+ projects. We guarantee no duplicates and correct operation under high load. Numbering automation pays off by reducing manual entry costs and operational expenses.
Order Bitrix24 document numbering setup — and forget about routine. Contact us for a free consultation. We will evaluate your project within 1 business day.







