AnsweredAssumed Answered

Auto generated sequential number

Question asked by ale_carraro on Dec 14, 2011
Latest reply on Dec 16, 2011 by mitpatoliya
I'm looking for something that should be supported out of the box, or just can be very easy to implement, because it is the most common use case for a Document Management System that I can think for

I'd like to write in a property (defined in a custom type or in a custom aspect) on node creation containing the max()+1 of its kind.
For example, if I insert a document of type X (or specialize an existing document) I'd like to have x.progressiveId = (number of documents of type X)+1 and the property should be unique.

Better, if I can put a partition value (for instance, the max()+1 should be implemented taking in account another property, for instance a property "year" so that 1st of January we can start again from 1)

Are there tutorials/best practices I can follow?

I've a rough idea of the path to implement it (use behaviors/store the current max() value in a node with known id) but if there is something 'ready' i would be much happier!

thanks to everyone