You'll need the following things to achieve what you're trying to:
- 1 ItemAdding event receiver which is attached to every list (only those lists apply which use your custom unique ids) link
- a central place where you store your current id (e.g. SPWeb PropertyBag) so you can increment it whenever a value has been used
public static class PropertyBagExtension
{
public static void AddProperty(this SPWeb web, string key, string value)
{
web.AllowUnsafeUpdates = true;
web.Properties[key] = value;
web.AllProperties[key] = value;
web.Update();
web.Properties.Update();
}
public static void RemoveProperty(this SPWeb web, string key)
{
web.AllowUnsafeUpdates = true;
web.AllProperties.Remove(key);
web.Properties[key] = null;
web.Update();
web.Properties.Update();
}
public static string GetPropertyValue(this SPWeb web, string key)
{
if (web.AllProperties.ContainsKey(key))
return web.AllProperties[key].ToString();
return null;
}
}
- a mechanism which ensures every day, that the id is set to 01 again in the beginning (could be done in the event receiver too)