Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have gone through hundred of articles over months but never understood as what could be the reason Item Updated and Item Added trigger together when we upload a item, even though if you try this.DisableEventFiring();

Can someone with deep knowledge of sharepoint point me in right direction, I have gone through similar questions but non of them are effective.

And if Item Updated have to trigger on Item Added then I wonder why Microsoft bothered creating Item Added event at all ?

share|improve this question
    
Are the documents being loaded Office Documents? –  Simon Doy Feb 6 '13 at 15:06
    
@SimonDoy yup they are –  Muhammad Raja Feb 6 '13 at 15:12
    
I seem to remember hearing about the fact that SharePoint will populate certain fields from Office Documents into the SharePoint List Item. I think its called Property Promotion. Wonder if this is the reason why. I guess you could test this out by uploading a PDF file and see if you get the same ItemAdded ItemUpdated events being called. –  Simon Doy Feb 6 '13 at 15:57
add comment

1 Answer

up vote 1 down vote accepted

When you add a document to your document library the event ItemAdded was called. If you work with the standard upload, after that the document has been added, a popup window will be open to insert the metadata of your document, this fires the ItemUpdated event.

Why? The reason is simple. When the file is saved, after the ItemAdded event, its metadata will be empty. So when you insert the metadata by the popup you just update those.

share|improve this answer
    
Before you reach "ItemUpdated" screen or form to update meta data of item it triggers ItemAdded and ItemUpdated events. –  Muhammad Raja Feb 6 '13 at 15:12
    
I think it is for the same reason. Instead if you updated an item only the ItemUpdated event will be fire –  Salvatore Di Fazio Feb 6 '13 at 15:13
    
@SalvatoreDiFazio is correct, if there is no metadata to be filled for the uploaded document then only ItemAdded event is fired and if there is metadata to be filled, then ItemUpdated event will be fired. –  Nadeem Yousuf Feb 6 '13 at 15:39
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.