I have created a integer field in my form called SortOrder that uses the 4-digit year date part + 3-digit number, Ex: 2013000, 2013001,2013002 etc. (I will actually display it in the library in another field like this: 2013-000, 2013-001 etc).
Here's how my sequential numbering works:
I have a field called SortOrder. If there are no items in the library SortOrder will become YEAR000 (or 2013000, 2013001, 2013002...), then the next item will become max(@SortOrder) +1 as long as the library is not empty. If all items were deleted from the library, the numbering would start over OR if there are existing items in the library BUT it's a NEW YEAR, the numbering will start over by multiplying the 4-digit year * 1000.
On form load rules there is a Year date check: if [substring-before(today(), "-") - substring(max(@SortOrder), 1,4)) = 0], then [max(@SortOrder) + 1]; if Year date check = 1, then [substring-before(today(), "-") * 1000]
This works when the same person is always creating the form or is in Design mode on local machine, but it randomly works when others create the form from the library directly. For example, if library is empty user1 creates a form 1st, it starts with 000, if user 2 creates a form next (2nd), it may start with 000 or 001, if user1 creates their 2nd form or is now the 3rd item added to the library, it may start with 001.
I am setting permission by item on the library using a SPD workflow but I removed the workflow (i.e. permissions) on the library to rule out that being the issue and it still behaved this way.
Is there something obvious I am missing with the numbering?
I am not using any special qRules or DBXL - it's a fairly simple form other than there are 20 views.