How to get task name while deleting in EventReceiver?
-
09-12-2019 - |
Question
I have written my Custom function into the EventReceiver created on Tasks.
public override void ItemDeleted(SPItemEventProperties properties) { base.ItemDeleted(properties); MYCustomFunctionforDelete(properties); }
I want to save the TaskName into my CustomList, when I delete any task from TaskList.
I am able to get the Name of TasksList, but not finding TaskName which is going to delete.
How can I do this ?
Solution
I think you should be using the ItemDeleting event to get the name of the task. Since ItemDeleted event happens after the item is deleted you cannot get information about something that already does not exists. There is a reference about the event properties : http://www.c-sharpcorner.com/blogs/4223/before-propertiesafter-properties-and-listitem-in-sharepoin.aspx