cancel
Showing results for 
Search instead for 
Did you mean: 

How to auto create folder name

KT
Champ on-the-rise
Champ on-the-rise

I need to create auto case numbering like...

Case Number prefix should be ERQ- and suffix should be incremented by 1 for each request. 1st request should be EQR-1, next EQR-2 and so on.

5 REPLIES 5

scampoy1
Confirmed Champ
Confirmed Champ

Hi @KT 

You have to add your custom logic into the Repository. So, you have three options:

- Creating a rule which exucutes a custom JavaScript with your logic.

- Developing a custom Behavior that runs your business logic.

- Executing your custom logic on external SpringBoot application using the newly SDK 5 for events.

Pay attention that both solutions may decrease the Repository performance because on every folder creation event the system will listen It and fires your custom logic.

I would recommend you the third option.

Please let me know if you need more additional information about that.

KT
Champ on-the-rise
Champ on-the-rise

Hi @scampoy1 

I'm new to the Alfresco World. So can you please help me with more information about your solution

Thank You!

fedorow
Elite Collaborator
Elite Collaborator

1. Install javascript console. It present in the docker installer too.

2. Read this 3.0 JavaScript API

3. Read that Folder rules

4. Write your script and create your rule.

4535992
Star Collaborator
Star Collaborator

As alternative (and if you know how to develop on java) you can create a behaviour on the "create node of type folder" event for manage that

prorobin
Champ on-the-rise
Champ on-the-rise

I don't know what is your specific requirement, but if you need to create a custom logic outside Alfresco (example: an external service that creates your folders using the Alfresco REST API), you can easily use the autoRename parameter described at https://api-explorer.alfresco.com/api-explorer/#/nodes/createNode .

If true, then a name clash will cause an attempt to auto rename by finding a unique name using an integer suffix