How to auto create folder name

cancel
Showing results for 
Search instead for 
Did you mean: 
KT
Partner

How to auto create folder name

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
scampoy1
Partner

Re: How to auto create folder name

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
Partner

Re: How to auto create folder name

Hi @scampoy1 

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

Thank You!

fedorow
Senior Member II

Re: How to auto create folder name

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
Senior Member

Re: How to auto create folder name

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
Active Member

Re: How to auto create folder name

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