Naming series is a global counter. So if you used .#### for the counter, then any DocType that has a .#### counter in their naming series will update that counter. So if you create 0001 in one DocType, then if you create a record in another DocType with a .#### series, it will create as 0002.
In ERPNext, using Document Naming Rule, you can start a counter from 0 by creating a custom Naming Series for your DocType. For Eg in Document naming rule set : DOC- and select the doctype. give the prefix and start series from.
- Optionally, set the number of digits in the series using dot (.) followed by hashes (#). For example, “.####” means that the series will have four digits. Default is five digits.
- You can also use variables in the series name by putting them between (.) dots
Supported Variables:
If we want to use a DocType Field value how can we use it in the series?
Example: If there is a Field name "called “custom_main_procurement“, and I want to use that value in the naming series, how to use that in the naming series?
format:RFQ/{custom_main_procurement_type}/.YYYY.
If a naming series is defined in the DocType, it will get override with the “Document Naming Rule”?
If we are to use a naming series like “RFQ/.{custom_main_procurement_type}./.YYYY.-”, which includes a field name, then it is not possible to use “Document Naming Rule”, right? Instead, we have to use DocType’s naming series? And if we use DocType’s naming series, is there any way to keep the count in order without skipping?
Once we set the prefix in the DocType naming series or from the “Document Naming Rule”, the prefix won’t be displayed in the prefix list in the “Document Naming Settings”. If type the prefix manually without selecting, it’ll set the count globally.
The prefix list in Document Naming Settings only displays naming prefixes that are configured or predefined globally.
Custom prefixes set within a DocType or naming rule are local to that DocType and hence not synced to the global prefix list.
If you want a specific starting number for the suffix, you can configure the Counter field in the Document Naming Rule.
For example, if you set the counter to 100, the next generated document will begin from 101.
Thank you for the Info. It was useful. I want to know when using a Document Naming Rule, if we use something like this RFQ/.{custom_main_procurement_type}./.YYYY.- is it possible to reset the counter once the Year has passed from 2025 to 2026?
Example RFQ/TEST/2025/0891 to **RFQ/TEST/2026/0001
**
If we have to set a Rule Condition, how to apply it?