We want to create an automatic document numbering system when users
upload new documents to a document library.
The initial idea was to implement it with a metadata property and use an
eventhandler to automagically set the metadata.
something like this:
if (listEvent.Type == SPListEventType.Insert)
{
SPWeb site = listEvent.Site.OpenWeb();
SPFile file = site.GetFile(listEvent.UrlAfter);
string key = "docid"; // the metadata property
if (file.Properties.ContainsKey(key))
{
file.Properties[key]= GetNewDocId(); // you get the idea
}
}
But for one reason or another, the object model does not support
updating file metadata.
So, I'm stuck for the moment.
Has anybody have any pointers for a new approach? I 'think' that I could
use webservices but - as far as I know - this is a more client-side
approach and I would like to keep this functionality on the serverside.
t.i.a
Koen