Domanda

i got a problem with checkincomments on a spfile object in SharePoint 2007. The checkincomments on a custom doclib with custom contenttypes and custom code in the itemadding, itemadded, itemupdating and itemupdated eventreceivers are not stored.

I found the following links regarding this problem http://social.technet.microsoft.com/Forums/en-SG/sharepointgeneral/thread/e7c42f6b-1dab-419a-aee6-010845b31ea0

and http://www.theblackknightsings.com/HowToChangeCheckinCommentAfterSave.aspx

But i dont want to make direct changes in the database so i haven't tried the last links solution.

In the itemupdating event you can get the comment by properties.AfterProperties["vti_sourcecontrolcheckincomment"]. In itemupdated this property is empty.

So following the first lik i store the comment in one of the custom content fields in itemupdating, get it from there in itemupdated and make a file.CheckIn("mycomment", SPCheckinType.OverwriteCheckIn) with disabled eventfiring.

When i upload a file to the document library a second time and increase versions by one (major versioning enabled), itemupdating and itemupdated are fired twice.

After the second itemupdating the asynchronous itemupdated seems not to be ready and i get an information that the file is currently in use by myself. So the update fails.

Is there any easier way to make sure that checkincomments in a custom documentlibrary are stored correctly?

Whats the solution for the second time the events fire?

Any help would be great!

È stato utile?

Soluzione

I have found the answer finally after days of research and testing:

http://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/ffed71b1-d255-4da3-90c7-537540c27a36

this helps!

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top