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'm updating item in SPListItemCollection using SPListItem.Upadte() but my event receiver is not receiving ItemUpdating/ItemUpdated events (breakpoints are not hit on either handlers).

Sample code that fails to invoke itemupdating event:

SPListItem opFolder = list.Folders.Add(strURL, SPFileSystemObjectType.Folder, strNewName);

opFolder["ContentTypeId"] = strNewContentType;
opFolder["ParentID"] = spf["NodeID"].ToString();
opFolder.Update();
share|improve this question
    
And you are sure you are not calling DisableEventFiring() before SPListItem.Upadte()? –  Diptarag Nov 22 '12 at 13:55
    
How did you register the event receiver? –  James Love Nov 22 '12 at 19:03
    
@JamesLove I've run it from VS2010. Receiver is working since i'm receiving ItemAdding from that same piece of code (im calling SPList.Folders.Add which fires itemadding before calling update on splistitem). Also itemupdating is fired when i add new item from SP DocLibrary itself. –  Nemanja Nov 23 '12 at 8:48
    
@Diptarag Nope, there is no DisableEventFiring call in the receiver or in webpart. –  Nemanja Nov 23 '12 at 8:49
    
Can you post your sample code here so that we can have a look –  Diptarag Nov 23 '12 at 10:31
show 2 more comments

1 Answer 1

Are you running this code with Elevated Priveleges?

If so it sends a SystemUpdate() which does not fire events.

share|improve this answer
    
I've been playing around this issue, and i've found that if i execute Update AND SystemUpdate in succsession, ItemUpdating event is fired? –  Nemanja Nov 28 '12 at 13:48
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.