views:

33

answers:

2

We would like to block the deletion of documents in a list based on some custom functionality.

What we have tried is to implement this in the ItemDeleting event. Where we set the cancel property of SPItemEventProperties to true when we do not want the user to be able to delete a document.

What happened was that the Delete option in the dropdown menu disapeared when the user was not allowed to delete a document. In a way this works, but the event is firing before the user actually tries to delete the document.

What is giving us problems is that the user can delete a document if they connect to the document library via MS Word 2003. In that case it does not appear that the ItemDeleting event fires.

Is there a way that we can get an event to fire and rollback the deletion when the document is deleted via MS Word.

Edit

Part of the problem could be that events do not fire in explorer view. Is there a fix for this "bug"?

+1  A: 

I do not have sharepoint development environment right now so I can not give the exact answer but you can check on one thing that when user performs any action on a document from MS Word 2003 ItemUpdating event is fired. You can explore ItemUpdating event to see what is going to happen with the document and then deal with it accordingly.

Azher Iqbal
+1  A: 

ItemDeleting - An event that fires before an item is deleted.

more click here

Vash
Thanks, in the end we found that our problem was that it was not firing at all since we were in explorer view
Shiraz Bhaiji