Microsoft Knowledge Base Article
This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved.
Terms
of Use |
Trademarks
Article ID: 939307 - Last Review: August 31, 2007 - Revision: 1.1
The ItemUpdating event or the ItemUpdated event occurs two times when you enable the Require Check Out option for a document library in Windows SharePoint Services 3.0
SYMPTOMS
When you enable the
Require Check Out option for a document library in Microsoft Windows SharePoint Services 3.0, the
ItemUpdated event or the
ItemUpdating event occurs two times. This occurs when the document library is updated.
CAUSE
By design, Windows SharePoint Services 3.0 works in this manner. When you check out a document in a document library, a local copy of that document is created. Changes that you make to that document are saved to the local copy. When you check in the document, the operation occurs in two separate steps. The local copy is first saved to the server. This save operation occurs even if you do not make any changes to the document. Then, a separate request is performed to check in the document. Therefore, the
ItemUpdating event or the
ItemUpdated event occurs two times.
WORKAROUND
To work around this behavior, examine the
vti_sourcecontrolcheckedoutby property inside an event receiver. If the
vti_sourcecontrolcheckedoutby property exits in the
BeforeProperties property but not in the
AfterProperties property, the event was caused by checking in a document.
The following sample code shows you how to do this.
if (properties.AfterProperties["vti_sourcecontrolcheckedoutby"] == null && properties.BeforeProperties["vti_sourcecontrolcheckedoutby"] != null)
{
//This is when the update event is triggered by check-in.
}
else
{
//This is triggered by events other than check-in action.
}
APPLIES TO
- Microsoft Windows SharePoint Services 3.0 Service Pack 1
| kbtshoot kbexpertiseinter KB939307 |
Community Feedback System
Very often, it takes hours to solve a problem. Very often, you've looked high
and low, and have tried a lot of solutions. When you finally found it, chances
are, it was because someone else helped you. Here's your chance to give back.
Use our community feedback tool to let others know what worked for you and what
didn't.
Please also understand that the community feedback system is not warranted to be
correct, it's simply a system that we've built to let people try and help each
other. If something in a feedback response doesn't make sense to you, or you're
not comfortable making changes that the feedback talks about (like registry
edits), please consult a professional.
Thank you for using kbAlertz.com Feedback System.
-- Scott Cate
Be the first to leave feedback, to help others about this knowledge base
article.
(Optional) Name
(Optional)
Public URL Or Email
Comments
No
HTML -- Text Only Please