Since there was no need for validation it sure looked like the event to use should be the ItemAdded event, but then all hell broke loose.
When calling Item.Update() SharePoint threw an exception :
Microsoft.SharePoint.SPException: Document Locked
The document you are attempting to edit is locked and cannot be updated.
Since this happened in the ItemAdded event we had to assume that the sequence was something like:
- Create new SPListItem
- Attach document to the SPListItem
- Release document
We found a posting from Jan Tielens (U2U) from back in 2004, but the solution he used was more like a hack so we really didn't liked it.
Some time ago I read some of the documentation for SPList and noted the description for SPList.SystemUpdate() :
Updates the database with changes made to the list item, without effecting changes in the Modified or Modified By fields.
Back in the day I worked a lot with systems based on optimistic concurrency control and the only reason for SystemUpdate() that I could see, was to bypass the concurrency control!!!!
But in this case that bypass proved to be very handy, as it solved the issue:
call .SystemUpdate() rather then .Update() and the ListItem is updated as planned.