Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

How to find name of deleted file

  Asked By: Weston    Date: Apr 22    Category: Sharepoint    Views: 1405

I am working on workflow. Can anyone know how can we find the name of file which is deleted.



4 Answers Found

Answer #1    Answered By: Jacob Green     Answered On: Apr 22

You have to create assembly and attach it to the document library u want. In the assemlbly u have to handle document library events( for eg if deletion operation is done) There is some predefined events like insert,delete..etc..i worked on this its working  fine

List of events.
Cancel Check Out - Changes made to a checked-out document are undone.

Check In - A document is checked in to the library.

Check Out - A document is checked out from the library.

Copy - A document in the library is copied.

Delete - A document is deleted  from the library.

Insert - A new document is saved to the library.

Move or Rename - A document is moved or renamed.

Update - An existing document or the value of a custom column in the library is edited.

Answer #2    Answered By: Spencer Bradley     Answered On: Apr 22

I have created assembly. But when to try to access properties in case of delete it give error. And microsoft msdn says

"'The delete event carries no useful information to log in the fields collection"


Answer #3    Answered By: Jay Ruiz     Answered On: Apr 22

Its working  fine for me,I am getting the file  properties which was deleted  from document library.

Answer #4    Answered By: Graham Ingram     Answered On: Apr 22

If listEvent.Type = SPListEventType.Delete
Dim site As SPWeb = listEvent.Site.OpenWeb();
Dim file  As SPFile = site.GetFile(listEvent.UrlBefore); // by using file.name property u can access the filename

Debug the assembly by attaching w3wp process when deleting the document in doclibrary bcos you cant print filename through assembly

Didn't find what you were looking for? Find more on How to find name of deleted file Or get search suggestion and latest updates.