Auto-Generating Serial Numbers with Custom Number Series in Zoho Creator
When working with business applications, it’s often necessary to generate unique identifiers for records such as requests, invoices, or assets. While Zoho Creator provides a default auto-number field, it doesn’t always allow the flexibility businesses need—such as custom prefixes, ranges, or increments.
Inspired by the Number Series functionality in Microsoft Dynamics 365 Business Central, I developed a custom auto-numbering system in Zoho Creator that gives full control over serial number generation.
Why Custom Number Series?
Different organizations have different requirements for numbering their records. For example:
-
A Prefix to represent the type of record (e.g.,
REQ_for requests). -
A Starting Number to decide where the series begins (e.g., start at 1000).
-
An Increment to skip numbers in a defined pattern (e.g., +1, +5, etc.).
-
An Ending Number to enforce a limit (e.g., stop at 9999).
This flexibility makes it easier to manage records, avoid duplication, and align with company standards.
The Table Setup
In my case, I created a No_Series table that allows administrators to configure the numbering series. Example fields:
-
Number_For– The entity (e.g., "Expiry Request") -
Prefix_of_The_No– The prefix string (e.g.,REQ_) -
Starting_No– The first number in the sequence -
Increment_by_No– The step value (default1) -
Ending_No– The last number allowed
The Auto-Numbering Script
Here’s the Deluge script I used inside the form’s On Add > On Success workflow:
How It Works
-
Fetch Number Series Setup
-
It checks the
No_Seriestable for the matching record (Number_For == "Expiry Request").
-
-
Assign Defaults if Not Found
-
If no custom setup is found, it defaults to:
-
Prefix:
REQ_ -
Start:
1000 -
Increment:
1 -
No Ending Limit
-
-
-
Get Last Used Number
-
It looks at the last record created and extracts the numeric part.
-
-
Generate Next Number
-
Adds the increment to the last number, ensuring it doesn’t cross the ending limit.
-
-
Assign to Record
-
Updates the
Request_IDfield with the new number.
-
Benefits of This Approach
✅ Flexible numbering system similar to ERP standards
✅ Avoids duplicate numbers
✅ Easy for users to identify record type from prefix
✅ Supports multiple entities with different numbering rules
Final Thoughts
With this approach, you can create a scalable and customizable auto-numbering system in Zoho Creator that adapts to your organization’s needs.
This method is highly useful if you’re coming from an ERP background like Microsoft Dynamics 365 Business Central, where number series are a standard practice.
You can extend this solution by:
-
Adding year/month prefixes (e.g.,
REQ_2025_1001). -
Resetting numbers annually or per project.
-
Allowing admins to configure series dynamically via a dashboard.


Comments
Post a Comment