Hello community, we would like to use the autonumbering feature described on the Academy website. However, we want the number to be assigned after a record is saved, not when the record is created. It is important that no number is "wasted" when a record entry is cancelled. Is there an easy way to do this?

Like 0



Hello Alexander, 


when implementing autonumbering on the back-end, you can choose any action you want in the replacing object. 

In your case, instead of the default "Before record added", you can set the process to be triggered by the "After record saved" event.


Best regards,


Hi Max,

thank you very much for your reply. We tried it, but it wasn't possible. Could it be that the "Invoice" module in the original "Invoice" object blocks the creation of individual event BPs?

Alexander Lovenjak,


The original object should not block the creation of the event BP's.

Have you tried using the "Before record updated" event?


When an object is saved it basically sends an Update query to the database so this event should work properly.


Best regards,


Hi Max, thank you for your help. It seems, that there is a bug within the invoice object. Creatio consulting tries to find it. The event handling changes doesn't help.

Best regards


Show all comments

I am trying to add an auto-numbering field on Opportunity.


I successfully did this with the Product object just like the guide said. It was very easy.

But when I try to do the same thing on Opportunity, there are some differences. Opportunity does not have the inherited Code –property or the methods called in the code under onEntityInitialized()

I have only tried the client-side solution.

Best regards,

Like 0



Hi, Julius!

As you have your own field in Opportunity (e.g. "UsrCode"), so you can use:

    onEntityInitialized: function() {
                 // onEntityInitialized method parent realization is called.
                // The code is generated only in case we create a new element or a copy of the existing element.
                if (this.isAddMode() || this.isCopyMode()) {
                    //  Call of the Terrasoft.BasePageV2.getIncrementCode base method, that generates the number 
                    // according to the previously set mask. 
                    this.getIncrementCode(function(response) {
                    // The generated number is stored in [Code] column.
                        this.set("UsrCode", response);

Dear Julius,

Since opportunity section does not have an existing Code column, you can create one using means of section wizard.

No special methods needed for new column, since we are calling parent realization in the onEntityinitialized method, which has the logic of working with auto incrementing. Just be sure to indicate your custom column in the this.set method by its name, but not title.

As for the back end realization of the auto incrementing, follow the instructions just the same, but indicate name of the custom column.




Anastasia Botezat, Vladimir Sokolov,
I tried this again. But it's not working. No value gets set.

I have created the System Settings, the Property on Opportunity, And I have adjusted the JavaScript to have the correct string value, "UsrCode".

It's not working this time either. Is the on-client method unavaliable on the Opportunity object?

Maybe the Opportunity object does not know the Systems Settings i Created. The system settings code names are : OpportunityLastNumber and OpportunityCodeMask

UPDATE : It is working while using Copy. But no Code is set when adding an Opportunity with the Mini-Page. I am now working on this. Any advice appreciated.

UPDATE 2 : Creating and Copying works as long as I do not have a Mini-Page. I tried to add the same JavaScript in the MiniPage methods{}. But that's not working. Any tricks to use MiniPages?


The auto increment logic is not a part of basic mini page logic. The 

getIncrementCode method is written on the BasePageV2. However, mini pages are inherited from BaseMiniPage, which does not have such method.

You can add the getIncrementCode method realization to the mini page, so that it will execute the logic. 

As for the back-end part, the changes are displayed on the client side only after record is saved. Therefore, it is impossible to view the code value on the opportunity page immediately. 



Anastasia Botezat,

 I did not get this to work with Mini-Page. I have anyway decided to work without the mini-pages. When Creating a Opportunity I just get the regular edit page where the incremented numbers work fine. Thank you.

Anastasia Botezat,


This dint worked  even to me. 


I have posted the issue in detail in the above link. Please help!!!!



Show all comments