Document Naming Rule

Hi To all,
I create a rule in Document Naming Rule, I see that the counter increase, but when i delete an object I’d like that the counter decrease like for example with Document Naming Setting series, instead this don’t happen.

Anyone can help me?
Thanks
Alessandro

@alaurucci By using autoname method, use your own logic

class Project(Document):
    def autoname(self):

But you need to take extra care when creating the name. Consider that you are calculating the total count and assigning total count + 1 as the new name. This will work if you delete the last record. However, if you delete an old or middle record, it will create an issue. Use the logic carefully.

@alaurucci there is no functionlity of decreasing counter in document naming rule.you have to do some customization for that

Also decreasing counter might get conflicted if someone restores that object from Deleted Document, make sure to compensate for that as well.