Updating the Current Value of a Naming Series
The Naming Series feature in ERPNext allows you to define a unique prefix and sequential numbering pattern for documents. For example, if a Sales Order uses the prefix SO, the generated document names will follow a sequence such as SO-00001, SO-00002, and so on.
In addition to defining naming patterns, ERPNext allows you to update the current sequence number of an existing naming series. This is especially useful when migrating from another ERP system or when correcting sequence-related errors.
When Should You Update the Current Value?
Updating the current value of a naming series is commonly required in the following situations:
- Migrating historical data from another ERP or accounting system.
- Continuing document numbering from an existing sequence.
- Correcting duplicate name errors caused by an incorrect sequence number.
- Synchronizing the naming series with the highest existing document number.
Scenario: Continuing Numbering After Migration
Suppose your previous ERP system contains 322 Sales Orders, with the latest document named SO00322. After moving to ERPNext, you want the next Sales Order to be generated as SO00323 instead of starting from the beginning.
You can achieve this by updating the current value of the Sales Order naming series.
How to Update the Current Value
Step 1: Open Document Naming Settings
Navigate to:
Settings > Document Naming Settings
Open the Update Series section.
Step 2: Select the Naming Prefix
Choose the prefix whose numbering sequence you want to update.
For example, if updating Sales Orders, select the prefix SO.
Step 3: Verify the Current Value
ERPNext automatically displays the current sequence number for the selected prefix.
For example, if your system currently shows:
- Current Value: 12
but your previous system already contains documents up to SO00322, replace the value with:
- Current Value: 322
Step 4: Update the Series
Click Update Series Number to save the new sequence.
The next Sales Order created will automatically be assigned the number SO00323.
Resolving Duplicate Name Errors
Sometimes you may encounter an error similar to:
Duplicate name Item Price RFD/00016
This indicates that ERPNext attempted to generate the document name RFD/00016, but another document with the same name already exists.
This usually happens when the current value stored for the naming series is lower than the highest document already present in the system.
Example
Assume the following:
- The highest existing Item Price document is RFD/00022.
- The naming series current value is incorrectly set to 15.
When ERPNext creates a new Item Price, it attempts to generate RFD/00016, resulting in a duplicate name error because that document already exists.
To fix this:
- Open the Item Price list.
- Identify the document with the highest sequence number.
- Navigate to Settings > Document Naming Settings.
- Select the RFD prefix.
- Update the current value to 22.
- Click Update Series Number.
After updating the sequence, the next Item Price document will be created as RFD/00023, eliminating the duplicate name error.
Another Example: Duplicate ToDo Number
You may also encounter an error such as:
Duplicate name ToDo TDI00014286
This means the current value for the TDI naming series is out of sync with the actual documents stored in the system.
To resolve the issue:
- Open the ToDo list.
- Find the highest existing ToDo ID.
- Go to Settings > Document Naming Settings.
- Open the Update Series section.
- Select the prefix TDI.
- Update the current value to match the highest existing document number.
- Click Update Series Number.
Best Practices
- Always verify the highest existing document number before updating a naming series.
- Update the current value immediately after importing historical data into ERPNext.
- Use separate naming prefixes for different document categories whenever possible.
- If duplicate name errors occur, check the naming series before creating additional documents.
- Avoid manually modifying sequence values unless necessary, as incorrect values can lead to naming conflicts.
Important Notes
- Updating the current value affects only future documents and does not rename existing records.
- The same procedure can be used for any document type that supports customizable naming series.
- Keeping the current value synchronized with existing records helps prevent duplicate document names.