How to Set Up Document Numbering with Prefixes
Document numbering with prefixes turns a plain counter into a number people can read: a letter or a code for the type of contract, then the sequence. In Planfix, the deal number is assigned the moment the deal appears on the board, and the contract number is calculated by a script that also writes it into the task fields and into the document itself. This three-minute video shows both formats, the simple numeric one and the advanced one, as part of business process automation.
What You’ll Learn: How to Number Deals and Contracts Automatically
- How automated document generation with advanced numbering works end to end (0:00).
- Which two fields the deal card needs for deal numbers and contract numbers (0:39).
- How to prepare the main field and a Word template with variables (0:58).
- How the script calculates the number and attaches the generated contract (1:21).
- How to be reminded to reset the counter every year (1:52).
How to Set Up Automatic Numbering in Planfix, Step by Step
Step 1. Add Two Numbering Fields to the Deal Card
Numbering is configured at the object level, and in the video the object is the deal. Open the card settings and add a field for deal numbering: a Number field with automatic numbering and no duplication enabled. In Next value, enter the number the sequence should start with. Then add a field for contract numbers: a Short text field, also with no duplication. The deal card is now ready.
Step 2. Create the Main Field for the Advanced Number
Before the automation, create a main field called contract number. It is a Number field with its value set to zero, and it is the counter the script reads and recalculates. The readable part of the number, the prefix or the letters, is added later during the calculation, so the counter itself stays a plain number.
Step 3. Build the Word Template with Variables
Write the contract in Microsoft Word and add the variables for the deal data you want inside the text, including the contract number. Then upload the finished file to Planfix as a document template. When a document is created from the template, each variable is replaced with the value from the current task, so the number in the paperwork always matches the number in the deal.
Step 4. Connect It All with One Script
Create a new script for the deal object, name it, then add the trigger and the conditions that make it run, such as the deal moving to the contract signing stage. In the actions, the script should:
- recalculate the contract number main field;
- create a subtask from a template;
- calculate an Infoblock that builds the advanced contract number and set that value in the matching field of the new subtask;
- update the name of the subtask and attach the document generated from the template.
Step 5. Plan the Annual Reset
Set up a recurring task as a reminder: choose the object, give the template and the tasks created from it a name, put the instruction in the description, then set the recurrence, for example every year on January 1 at 9:00 a.m. To reset the sequence itself, open the deal number field for editing and change Next value to 1.
Simple Numbers or Letters and Prefixes
A plain sequence is enough when every contract is the same kind of document. As soon as you have several kinds, or several branches, an alphanumeric number saves time: the prefix says what the document is, and the counter says which one it is. Because the number is calculated in an Infoblock rather than typed, the same value flows into the deal name, the task field and the attached file at once, and the next contract continues the sequence without anyone checking the previous one.
Who It’s For
- Sales teams: the deal gets its number on creation, and the signed-ready contract appears as a subtask with the document attached.
- Legal: prefixes separate contract types, so a number alone tells you what you are looking at.
- Finance and accounting: unique numbers in deals and documents make reconciliation and audits simpler.
- Administrators: the format lives in the Infoblock and the main field, so you can change it without touching the deals already closed.
FAQ
Can deal numbers be assigned automatically in Planfix?
Yes. Add a Number field with automatic numbering and no duplication to the deal card and set the starting point in Next value. The number is then assigned when the deal is created, with no manual entry.
Can a document number include letters and a prefix?
Yes. The script calculates the number in an Infoblock, which lets you combine letters, a prefix and the counter from the main field, and then writes the result into the task field and the generated document.
How do you start numbering from one again each year?
Open the deal number field for editing and set Next value to 1. A recurring task set for the first of January is the simplest way to remember to do it.
Final Thoughts
Decide on the format first, then build it once: two fields, a template and a script are enough for the whole sequence. If you have not worked with templates before, start with creating a document template in Planfix. New to Planfix? Sign up and set numbering up on a test deal.
This video was featured in What’s New in Planfix: October 2026.
