I am trying to create a functionality for a list where all entries get a custom ID. The IDs are going to have the following formats
List1
Year-1
Year-2
Year-n
List2
Year-1.1
Year-1.2
Year-1.n
Year-n.n
Now I have looked up a bit and the solution for custom auto incremental fields appears to be the following:
- Create a new list with a CounterName, a LastNumber and a NextNumber
- On your CustomList create a Workflow which retrieves the NextNumber
- Then increment the LastNumber on your CounterList (NextNumber is a calc. field)
Well so far so good, this works if i have set counter names. The problem is: Years on List1 and the "Name" on List2 are pretty variable. And every variable needs a new Counter like "Counter2012", "Counter2013", "Counter2014" and "Counter2012-1", "Coutner2012-2", etc...
Now with SharePoint Designer, to my understanding, there appears to be no way to check if a List contains an item with a given value.
Now up for my questions:
- Is my above assumption correct, is there really no way to check if a listitem with a specific value exists?
- Right now I'm trying the SPD-way, is there possibly a VS-way to achieve my goal?
Summing it all up, I basically want a workflow to do this:
Check if List "Counters" has an Item with "CounterName" == "BLA-%YEAR%"
No: Create Item with "CounterName" = "BLA-%YEAR%"
Yes: Simply continue
Next Workflow steps are not specific to this question and work fine.. ;)
This is the source where I got my initial idea from: http://splittingshares.wordpress.com/2008/04/11/auto-increment-a-number-in-a-new-list-item/