Developing Bitrix24 CRM document templates

Our company is engaged in the development, support and maintenance of Bitrix and Bitrix24 solutions of any complexity. From simple one-page sites to complex online stores, CRM systems with 1C and telephony integration. The experience of developers is confirmed by certificates from the vendor.
Our competencies:
Development stages

CRM Document Template Development for Bitrix24

In Bitrix24, a manager creates a deal, clicks "Generate Document," and receives an act or contract — but with empty fields where client details should be, the amount in words doesn't match the numeric value, and the company logo is missing. This is the typical picture after initial implementation: out-of-the-box document templates are minimal and need to be adapted for real business tasks.

CRM Document Template Development for Bitrix24

How Document Templates Work in Bitrix24

Document templates in Bitrix24 are available under CRM → Settings → Document Templates (depending on the version, also accessible from a deal or invoice card). This functionality is part of the crm module and runs on the built-in templating engine.

Templates are created in docx format (Microsoft Word) — this is the key point. Bitrix24 uses docx as a template format with placeholders in double curly braces: {ContactName}, {DealTitle}, {TotalPrice}. When a document is generated, the placeholders are replaced with real CRM data, and the resulting file is delivered as docx or converted to PDF.

Available Variables (Placeholders)

The list of available variables depends on the document type (deal, invoice, commercial proposal, contact, company). Basic variables for a deal:

  • {DealId}, {DealTitle}, {DealOpportunity} — ID, name, amount
  • {ContactName}, {ContactPhone}, {ContactEmail} — contact details
  • {CompanyTitle}, {CompanyAddress} — company details
  • {AssignedName} — responsible manager
  • {CreatedDate} — creation date

For tabular data (product list in a deal), repetition blocks are used — docx sections with {#Products}...{/Products} markers.

Custom CRM fields (UF_CRM_*) are also available through corresponding placeholders — they need to be added manually to the template's variable list.

Developing a Template in docx

The process: create a docx in Microsoft Word or LibreOffice, place placeholders where needed, upload to Bitrix24. Critically important:

  • A placeholder must be a single text run in Word's XML. If a placeholder is typed character by character or part of it is formatted differently (e.g., the middle is bold) — Word will split it into multiple <w:r> elements and Bitrix24 won't recognize it
  • To verify, open the docx as a ZIP archive and inspect word/document.xml — the placeholder must be inside a single <w:t>
  • Tables with repeating rows require special markup: {#} and {/} markers must be in separate table rows, not mixed with data

Case Study: Service Agreement for an Agency

A marketing agency using Bitrix24 cloud. Managers were creating contracts manually in Word, copying data from CRM — spending 20–30 minutes per contract and sometimes inserting incorrect details.

We developed a contract template: agency details in the header (static text), client details pulled from company fields ({CompanyTitle}, custom UF fields for tax ID, reason code, address), contract subject from the deal field, amount from {DealOpportunity} plus amount in words via a custom UF field (entered manually by the manager, since automatic conversion to written-out numbers is not natively supported). Signatures — static lines with blank fields.

Result: the contract is generated in 10 seconds with no errors in the details.

Limitations and Workarounds

Bitrix24 cannot natively: convert numbers to written-out form, apply complex conditions in a template (IF/ELSE), or insert images from CRM. Workarounds: written-out amounts — via a custom UF field or robots that write the value; conditions — via multiple templates for different scenarios.

Timelines

Task Timeline
Developing a single template (up to 2 pages, standard fields) 4–8 hours
Template with complex product table and custom fields 1–2 days
A set of 3–5 document templates 3–7 days