SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to perform some Action once the item is added. I have a Custom List that reacts on Item Creation.

If, at this level, i want to Delete the item immediately once it is added, how could I do?

Thank you very much!

share|improve this question

As C.Marius mentions, if you are able to add custom code, go for a Event Handler.

To point you in the right direction, check this example out;

But would it not be better to prevent users to add the listitem in the first place?

Anyway, the most simple approach i can think off:

Public override void ItemAdded(SPItemEventProperties properties)

    properties.Cancel = true;

And dont forget to scope the Event Handler to the specific list in the Elements.xml, just change

<Receivers ListTemplateId="100"> 

to this

<Receivers ListUrl="Lists/someListName"> 
share|improve this answer

You can use sharepoint designer to create a list workflow for the list.

You can use conditions to determine if the item should be deleted.

Then you can delete the current item.

share|improve this answer

It will depend on the intended approach:

  1. By code - you always have Event Handlers (OnItemAdding - synchronous, which can be cancelled if a certain condition is not met or OnItemAdded - asynchronous - if you wish to perform some stuff prior to deleting it, that triggers after the actual item has been created). Great advantage of a handler is that you could tie that into a content type, certain list type - which increase reusability
  2. As Russell already mentioned, more declarative, for special cases, or if you are rather targeting Content types - a Reusable workflow.
share|improve this answer

Your Answer


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.