I am creating an Infopath document that interfaces with a Shaerpoint system. Within the document I am trying to create an intelligent autonumbering sytem that accounts for the fiscal year, the document type and also the number of the document.
For example if I create a pizza document it would be named 11-PIZZA-01,
11-PIZZA-02, etc. If I create a Ham document it would be named 11-HAM-01, 11-HAM-02, etc.
I am doing this by creating an individual count for each type of document that increments whenever a person creates a document of that type. These are stored in a column called num_pizza, num_ham, etc. When a person creates a document of a specific
type I use the max function and add one to it in order to increment the number. So to create the number I use, concat(fiscalyear"-", doctype, "-",
max(num_pizza) + 1).
My issue is when the new fiscal year begins, I want to go back to one and start all over. But in using the max function it will just keep incrementing. Is there a way to just take the last item from those columns? If I can do that,
then I can just reset the first item of the new fiscal year to one and just start adding from that. Or is there just a better way of going about this?
I hope I didn't say too much.Read more...