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

The following articles...

...attempt to address a problem that I just cannot seem to solve.

Basically, I've deployed an event receiver that deals with the item added event to a custom list I have created. This all works fine, and my code is hit (breakpoints) but I cannot find the newly added list item anywhere in the properties of SPItemEventProperties.

I've tried the two proposed solutions I've posted links to above and my code now currently looks like:

public class EventReceiver1 : SPItemEventReceiver
   List<String> explosives = new List<string>() { "gunpowder", "dynamite", "fireworks", "fuel" };

   public override void ItemAdding(SPItemEventProperties properties)

       SPSite CurrentSite = new SPSite(properties.SiteId);
       SPWeb CurrentWeb = CurrentSite.OpenWeb(properties.RelativeWebUrl);
       SPList CurrentList = CurrentWeb.Lists[properties.ListId];
       //The line below is where the error is ("Can't find item, may have been deleted by another user")
       SPListItem item = CurrentList.GetItemById(properties.ListItemId);

       if (explosives.Contains(item["Title"].ToString().ToLower()))
           item["Title"] += " (DANGEROUS!)";

But no joy. Any help is greatly appreciated.

EDIT: I should also mention that as an alternative to GetItemById, I did just try using CurrentList.Items.Count - 1 hoping the last item would be the new one, but it wasn't there either.

share|improve this question
up vote 4 down vote accepted

If you are calling the ItemAdding event, the ListItemId is not going to exist yet. Try using the ItemAdded event instead.

share|improve this answer
Thanks a lot @Blue Murphy, sorted. Can't believe I've missed that, embarrassing. Still, seems to be a problem that requires work arounds in other cases. Thanks again. – JᴀʏMᴇᴇ Apr 24 '12 at 15:15
Oh Jesus, now I feel stupid. – RJ Cuthbertson Apr 24 '12 at 16:02
It has nothing to do with intelligence. It's all in how you cock your head. – Blue Murphy Apr 24 '12 at 16:22

ItemAdded never fires in debug mode, lots of people having same issue

share|improve this answer
This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post - you can always comment on your own posts, and once you have sufficient reputation you will be able to comment on any post. - From Review – wjervis Dec 18 '15 at 19:35

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.