Hello,

I'm trying to add an auto-numbering field in the Leads section following the instructions here: https://academy.creatio.com/documents/technic-sdk/7-13/how-add-auto-numbering-edit-page-field

 

I've made the 2 new system settings required:

I've also made a replacing Lead object in the package I'm working on and added a new event trigger before the record is added:

The process triggered by this signal on the object is set up with the expected elements:

With conditional logic:

One thing I think is missing is how to tie the new system settings into this process.  Is there a schema or input I need to update for this?
 

Also, do the process element parameters need to be populated on the user task?

Thank you for your help finding what needs to be fixed to get this working!

Like 1

Like

2 comments
Best reply

Is your column on the Lead object really called "CreatioNumber"? (the code for the column)

You've verified that your User Task is really named "LeadNumberCreation"? (click the three-dot button on the top right and switch to advanced mode)

As for the system settings, the user task locates and uses those. 

As a side note, the new method is much easier (it works for classic as well as Freedom since it's simply added as a default value for the column). See https://customerfx.com/article/working-with-autonumber-fields-in-creatio/

Ryan

Is your column on the Lead object really called "CreatioNumber"? (the code for the column)

You've verified that your User Task is really named "LeadNumberCreation"? (click the three-dot button on the top right and switch to advanced mode)

As for the system settings, the user task locates and uses those. 

As a side note, the new method is much easier (it works for classic as well as Freedom since it's simply added as a default value for the column). See https://customerfx.com/article/working-with-autonumber-fields-in-creatio/

Ryan

I obfuscated the real code numbers for these screenshots but the ones I'm using do match the field column code and the user task code so that shouldn't be the problem.
 

That's great to know there is a more simple way to create an autonumber field right on the object now though!  I tried it and it worked so that solution will work fine.

Thank you so much for your help!

Show all comments

Hi,

 

Does anyone know what table they are in, I need to reset them once a year.

 

We, when a record is generated with Autonumber, we add to the Autonumber field, the year. So we need each year to have a new numbering, starting with 1.

 

Thanks in advance

 

Julio Falcón

Like 2

Like

10 comments

Hi Julio

The AutoNumber value is stored in a Sequence in the database (Postgres Sequence for cloud instances).
For example, you can get the last value of a sequence using this query:
SELECT last_value FROM "Contact_RId_seq".

To reset a sequence, you can use the following query:
ALTER SEQUENCE "seq_name"
RESTART WITH 0;

Hope this helps!

Mohamed Ouederni,

Thanks,

 

1.- But, can I access this data from a process? 

2.- Have access to this object from a process, 

3.- How to determine which sequence correspond with a specific section?

I have not visible this table from a Creatio Cloud instance, I've enabled an autonumber field in contacts, for example, and not available the table mentioned by @Mohamed, see it

 

Hi Julio

 

1- You can run a custom SQL query from a Task Script.
2- No, you don't have access to the sequences.
3- The sequence name is identical to the column UId. You find it in the source code tab of the Object in Advanced settings.

 

Thanks!

Hello Julio,

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, the find the column and get the Guid for the UId. 

That is the name of the sequence in the database. If needed, you can use that to get the next sequence value using this where the guid is the UId for the column (for Postgresql):

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

Then to reset it to 1 again you can use this (if needed, replace the 1 with whatever number you want the sequence to start at): 

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

To do this via a process, you'll need to do a direct database connection and you'll use a script task, see https://customerfx.com/article/executing-direct-sql-statements-in-a-process-or-configuration-web-service-in-creatio-formerly-bpmonline/

Lastly, if you want to get what the last value/number used from the sequence was, you can use:

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

Ryan

This is No Code ? In Classic UI was sImple, why in Freedom I need NASA certification to do this?

Julio.Falcon_Nodos,

Yes, for now to reset the value it requires the database update (either by Clio, SQL Executor, or asking support to update the value). I do hope we'll get a UI to manage that at some point. The prefix is also set at the object level now, instead of a system setting - so that now requires an object publish to change rather than updating a setting.

Ryan

Ryan Farley,

Thanks for your support Ryan

Julio.Falcon_Nodos,

Hello,

Yes, unfortunately at this moment there is no possibility to reset sequence using No Code. But you can always contact support, and we will be happy to do it for you. We have created a request to the responsible development team to add this functionality in future releases.  

Antonii Viazovskyi,

Thanks Antonii

Show all comments

Hi all

 

Somebody know where can I change or restart autonumbering, i need to define a process to eache year restart the numbers

 

I'm asking regarding the new Creatio feature to AutoNumber any entity (8.1)

 

Thanks in advance

Like 1

Like

3 comments

Hello, somebody can help me with this question please?

Hello,

 

Currently, no interface allows users to configure this manually, so the following steps need to be taken:



Identify the UId of the auto-numbered column.



For the identified column, use the script below to set a new starting number. In the examples provided, '4a40180c-61bf-de86-2f08-b05852a5ea6d' represents the UId of the auto-numbered column, and '1' is the next value from which the auto-numbering will proceed.



Script for MSSQL:

 

ALTER SEQUENCE [4a40180c-61bf-de86-2f08-b05852a5ea6d]
RESTART WITH 1;



Script for PostgreSQL:

SELECT setval('4a40180c-61bf-de86-2f08-b05852a5ea6d', 1, false);



If you need further information or assistance, please reply to this message and we will be happy to help you.

 

Thanks, I need to reset them yearly in a process, how can automatically fit it?

Show all comments

Hello,



We are working on adding a custom section in the mobile application. Everything is working fine but the AutoNumber field is not getting populated. I have seen in "Cases" that the auto numbering is working fine. Any help would be appreciated. Thanks

Like 0

Like

3 comments

Hello,



Currently, auto-numbering of fields in an object is a new functionality that the mobile app does not yet support. Support for this functionality will be available at the beginning of the new year.  



If you need auto-numbering on an object and want it to work everywhere, both on the web and in the mobile app, you need to implement the auto-numbering logic not through default values, but by implementing it in code on the object.

@Malika,
Do we have any updates on this? We are still encountering the same issue.
If you have any code pertaining to this problem, could you please share it with us?

 

Note: Creatio Version : 8.1.2 using it 

 

Regards,

Bala koteswarareddy.

Hello!

 

This functionality was released in the 8.1.0 version. As we see, you mentioned that you use 8.1.2, so should have it. 

In case you don`t have it, please contact the Support Team via support@creatio.com and provide the instance with which you have an issue.

 

Have a nice day!

Show all comments

Hello, 

I'm using [Autonumber] field for managing record number data automatically like in the documentation   , Set up an [Autonumber] field | Creatio Academy 

Now, i need to reset the increment  to the 0  if the user clicks  on a button

How to reset the increment ? any idea !

Thank you 

Like 1

Like

1 comments

Hi,

There's no direct way to reset the auto number field. 

It's based on the Sequence object in the DB, you can run the script that will restart the sequence. For example, you could create a business process that will execute a script that will restart the sequence. 



Best regards,

Yuri

Show all comments

Hello,

I want to auto-number in a Custom module in Studio, the numbering I will do will be handled with different values and must be sequential. I need an answer on how to do it.

Like 0

Like

1 comments

Hello Burak,

 

Please find the instruction for Freedom UI by the link below:

https://academy.creatio.com/docs/user/nocode_platform/element_setup_exa…

And for classic UI (required development skills) by the link below:

https://academy.creatio.com/docs/developer/interface_elements/record_pa…

Show all comments

Hello Community,

How to write the auto-numbering of field using Stored procedure SQL

 

Thanks In Advance

 

Like 0

Like

5 comments

Hello,

 

Please note that autonumbering became available starting from Creatio version 8.0.5, you can find more info in this Creatio article and this:

 

It is now possible to number new records in Freedom UI automatically quicker and easier using the [ Autonumber ] field. You can set the number prefix and change the quantity of digits in the number. Creatio populates the field both when you add a record manually and when a business process or integration add it.

 

Mira Dmitruk,

Yes but i need this for the 8.0.0 version

Honey,

 

In such case this article should provide the needed instructions.

Mira Dmitruk,

Thanks but the requirement is with stored procedure 

Mira Dmitruk,

Hello, We have a cloud instance where we need to run auto increment based after insertion. Do we have any examples ?

Show all comments

Team,



We have an option to set the field value automatically in an incremental order when a record is created/added to the section.

 

Creatio Academy Article:

Here, is the link to Set up auto numbering for the [ Code ] field in the [ Products ] section

https://academy.creatio.com/docs/node/2311



For any Custom Section, Kindly follow the below guidelines while creating system setting:

Server-Side Implementation:

Let us consider the custom section object is "Transaction" and the system setting - Prefix for object name is "Usr" and the field called Transaction Number(UsrTransactionNumber) has to be auto-numbered.

 

For the Custom object, Replacing object is not required as you have control over your object, click on the object and check the "Before Record Added" checkbox.



The name of the System setting created for auto numbering should be as below,

1.UsrTransactionCodeMask (Prefix + Object name + "CodeMask")

2.UsrTransactionLastNumber (Prefix + Object name + "LastNumber")

 

-->In the Condition flow, use your Custom field name instead of code as below, 

string.IsNullOrEmpty(Entity.GetTypedColumnValue("UsrTransactionNumber"))

 

-->In the business process, script task use your custom field name instead of Code as below, 

Entity.SetColumnValue("UsrTransactionNumber", UserTask1.ResultCode);

 

-->Name the script task elements as ScriptTask1, ScriptTask2 & user task element  as UserTask1 as mentioned in the article.

 

a)Transaction Code Mask

b)Transaction Last Number

 

 

Best Regards,

Bhoobalan Palanivelu.

Like 0

Like

Share

2 comments

Hi 

This solution is not working for me in case of a custom section object. I have used the exact same steps as mentioned by you in this article and in the Creatio Academy. I tried this in Creatio 7.18v.

 

Thanks

The link to the documentation is dead. Here is the new link : https://academy.creatio.com/docs/node/2311

Show all comments

hi all,

I'm doing the server side auto numbering shown in this link on a created package and a created section 

- my section is called returns 

- my field that i want to make auto number is Code 

"https://academy.creatio.com/documents/technic-sdk/7-15/how-add-auto-num…"

 

 followed all the steps shown in screenshots and doesn't work ? 

and here from the object file i opened the process and made this 

 with these configurations

Message:

conditional flow: 

conditional flow formula:

Get entity schema to generate number:

Generate number and error icon :

Save number to entity column:

 

any sol please 

thanks all 

Like 0

Like

6 comments

Hello Ibrahim,

What is the name of the column in your returns object where the number will be stored? In the article on the academy website, it's using a column named "Code", but your column name is likely different, possibly something with a prefix in front of it, like maybe UsrCode?

You'll need to update the column name in two places:

  1. The conditional flow formula (replace "Code" with your column name)
  2. Save number to entity column (replace "Code" with your column name)

Also, it would be a good idea to verify the names of the process elements. The academy article assumes they are named "UserTask1", etc.   Verify the following:

  1. The task titled "Generate ordinal number", verify it's name by clicking the three-dots icon on the top of it's properties, then select "Advanced mode" and there you'll find it's name in the "Code" field. You'll need to update the code in your screenshot titled "Get entity schema to generate number" with this name - replace "UserTask1" with this value, if different.
  2. Do the same with the "UserTask1" value in the code in your screenshot titled "Save number to entity column", if different.

Lastly, if it is still not working, please post the error you receive when you publish.

Ryan

Dear Ryan,

 

Thank you for your answer, it is very helpful. Additionally to doing everything from the message above you have to put the whole process In the "Event sub-process element".

 

Ryan Farley,

Thank you for your answer 

Max,

yeeees that's it 

thank you 

Hi Ibrahim,

 

Could you please help me with what I am missing with the same implementation? I have created the post on it https://community.creatio.com/questions/event-trigger-issue

 

Thank you

How to do Auto-numbering using SQL Script using Stored procedure

Show all comments

Hi all,

as this link 

"https://academy.creatio.com/documents/technic-sdk/7-15/how-add-auto-num…"

 

i need to make auto numbering in custom section called returns 

i need to make "CASE IMPLEMENTATION ALGORITHM: SERVER-SIDE"

 

i made the first point "1. CREATE TWO SYSTEM SETTINGS" and created the two system settings 

in the second point " CREATE A REPLACING SCHEMA OF THE [PRODUCT] OBJECT" when i create and choose the returns section as parent object it gives me an error like that :

 

how can i solve this ?

thanks 

 

Like 0

Like

12 comments

Dear Ibrahim,

 

Thank you for your question!

 

As per the Article provided: 

Select a custom package and execute the [Add] – [Replacing object] menu command on the [Schemas] tab. Specify the [Product] object as the parent object in the new object properties

 

Please check if you are creating a replacing object within the Custom Package 

 

Thank you!

Hope this helps,

Regards,

Danyil

Danyil Onoprienko,

 

yes within the custom package 

 

 

Ibrahim Nour Eldin,

 

Thank you for your answer!

 

Please make sure that you specify the [Product] object as Parent when creating a replacing object

 

Thank you!

Regards,

Danyil 

Danyil Onoprienko,

 

thanks for your reply

i guess you doesn't read my question but i will explain to you 

i need to make auto number on a custom section not on products and my custom section is called returns 

 

thanks

Ibrahim Nour Eldin,

 

The Article provided is a guide on how to add auto-numbering to the [Products] section.

 

Since you have already created a custom section named [Returns] that is based in the Custom package (all new custom objects are being created and stored in the Custom package) you receive the following error as there would be two similar objects referring one to each other.

 

You may continue to step 3 if you are using a custom section named [Returns]

 

Step 2 is considered for those objects that aren't located in the Custom package initially (for example, you have developed a new package and imported it in a new system having the [Returns] section in that package - for these purposes, you would need to create a "Replacing Object" in a Custom Package on a new instance to which this package has been installed)



Hope this clarifies!

Regards,

Danyil

Danyil Onoprienko,

 

when i skip 2 and go to advanced setting to enable event handler i found two files with the same name for the Returns section on in the Custom Package and one in the Package i created 

where should i enable the event handler ? 

thanks 

Ibrahim Nour Eldin,

 

Thank you for your question

 

You may read on how to use the Object Designer to configure entity schemas here: https://academy.creatio.com/documents/technic-sdk/7-15/workspace-object…

 

Hope this helps!

 

Thank you

Danyil

Danyil Onoprienko,

 

you don't understand me in my last question i asked about where i enable event in the section file in my package or in the section file in the custom package 

 

thanks

Ibrahim Nour Eldin,

 

Thank you for specifying!

 

The Event Handler should be enabled in the Custom Package

 

Regards,

Danyil

Danyil Onoprienko,

 

when i build the business process in formula when i write the code it gives me this error 

thanks

Danyil Onoprienko,

 

any sol please for this ?

 

thanks

Ibrahim Nour Eldin,

 

Please contact us at support@creatio.com in order for us to provide the best possible solution

 

Thank you!

Regards,

Danyil

Show all comments