back to top

Resetting the Value of Autonumber Fields in Creatio

In current versions of Creatio, autonumber fields are now set as a column default value. This new type of autonumber field is much easier to create (the previous method involved creating system settings, then modifying the object subprocess or adding code to pages). The autonumber itself is done as a sequence in the database. For any autonumber columns, Creatio creates a sequence in the database, the name of the sequence is the columns UId.

Read more about database sequences for Postgresql or MSSQL

One thing that made the older method of working with autonumbers was that to reset the value of the autonumber (or change it to start at some new number) was easy, you simply modified the system setting. However, since this is now at the database level, this article will provide some useful functions for working with sequences (Note, since new systems for Creatio are Postgresql only, I’ll only be providing these for working with Postgresql sequences. Similar methods do exist for MSSQL that you can research)

Getting the Column UId

The name of the sequence will be the UId for the column. Once you add the autonumber column, you’ll need to get the UId for the column. You can open the object then select “Open metadata” under the Actions menu, then find the column and get the Guid for the UId. That is the name of the sequence in the database. For the samples in this article, I’ll be using the UId “ed398640-de69-842b-c50c-6c673da5aa98”. Obviously, you’ll need to replace that with the UId for your autonumber column.

Getting the Next Number in the Sequence

To get the next number in the sequence, you can use the following (Note, this will also increment the sequence value, meaning, it doesn’t just tell you the next number – the sequence position will now be on the next number):

SELECT nextval('ed398640-de69-842b-c50c-6c673da5aa98')

Checking the Last Used Number in the Sequence

If you’d like to view what the last number the sequence generated, you can use the following:

SELECT last_value FROM "ed398640-de69-842b-c50c-6c673da5aa98"

Resetting the Value of the Sequence

If you’d like to reset the sequence to start back at 1 again, you can use the following:

SELECT setval('ed398640-de69-842b-c50c-6c673da5aa98', 1, false); 

Note, the 1 in the above means that it will reset the sequence to the value 1. The false indicates that the 1 is not yet used, meaning the next number will be 1, not 2. If you wanted to set this to start at the value 58601, you’d execute the following:

SELECT setval('ed398640-de69-842b-c50c-6c673da5aa98', 58601, false); 

View all Sequences and Details in Database

Lastly, if you want to see all of the sequences in the database and details, such as their current value, etc. You can execute the following:

select * from pg_sequences

View more details on pg_sequences

Autonumber Prefix and Number of Digits

Note, that for autonumber columns in Creatio, the database level sequence just stores the current number. The prefix (such as “REQ-“, “SR-“, etc) and the number of digits are stored at the object level. View the column default value for the object to change the prefix and number of digits. See more in the article Working With Autonumber Fields in Creatio

Contact Customer FX for your CRM project
We let our expertise speak for itself - let us know how our all-star team can help on your CRM project
About the Author
Ryan Farley
Ryan Farleyhttps://customerfx.com/article/author/ryanfarley/
Ryan Farley is the Director of Development for Customer FX and creator of slxdeveloper.com. He's been blogging regularly about SalesLogix, now Infor CRM, since 2001 and believes in sharing with the community. His new passion for CRM is Creatio, formerly bpm'online. He loves C#, Javascript, web development, open source, and Linux. He also loves his hobby as an amateur filmmaker.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Building AI-Powered Workflows in Creatio Without Writing Code

See how Creatio can combine AI with no-code business processes to qualify, summarize, and route incoming leads while keeping your existing business rules and human oversight in place.

AI Readiness Checklist for CRM Teams: Is Your CRM System Ready for AI?

Before using AI in Creatio, make sure your CRM data, users, processes, and automation foundation are ready. Use this practical AI readiness checklist for CRM teams.

Build Your Creatio AI Skills with the 2026 AI Summer Program

Join Creatio’s free 2026 AI Summer Program to learn how to identify, build, deploy, and manage AI agents.

Creatio 10x Is Coming: Join the Webinar to Explore the Future of AI-Native CRM

Learn what's new in Creatio 10x and how AI-native CRM, agentic AI, and no-code automation are shaping the future of customer relationship management. Join the upcoming webinar and discover what's next.

Creatio Unlimited Pricing Explained: AI Packages, Costs, Pros & Cons

Learn what Creatio’s new Unlimited pricing model includes, what it doesn’t include, how AI Action packages work, and the pros and cons for businesses evaluating Creatio.

Related Articles

Building AI-Powered Workflows in Creatio Without Writing Code

See how Creatio can combine AI with no-code business processes to qualify, summarize, and route incoming leads while keeping your existing business rules and human oversight in place.

AI Readiness Checklist for CRM Teams: Is Your CRM System Ready for AI?

Before using AI in Creatio, make sure your CRM data, users, processes, and automation foundation are ready. Use this practical AI readiness checklist for CRM teams.

Build Your Creatio AI Skills with the 2026 AI Summer Program

Join Creatio’s free 2026 AI Summer Program to learn how to identify, build, deploy, and manage AI agents.

Creatio 10x Is Coming: Join the Webinar to Explore the Future of AI-Native CRM

Learn what's new in Creatio 10x and how AI-native CRM, agentic AI, and no-code automation are shaping the future of customer relationship management. Join the upcoming webinar and discover what's next.

Related Videos