Incrementing Unique ID for a document
Hi, Is there any method in Nuxeo Server to give each document a unique and incrementing ID when it is created? Not to replace the unique ID that is given by default, but an additional field like:
doc01 -> uniqueID = ef42fj… and incrementID = 00001 doc02 -> uniqueID = 42ab2.. and incrementID = 00002 [….] doc0N -> uniqueID = 9f2bc.. and incrementID = 0000N
Regards, Mark
Hello,
You can use the one function available in automation Fn.getNextId
. So you can use it on a SetProperty operation setting a value as @{Document["prefix:property"]}-00@{Fn.getNextId("my_counter")}
for example where “my_counter” can have any value (it is just the counter name, useful if you have several counters).
Regards