0

I have this code where only ItemAdding is firing when I add new item in the list but ItemUpdated doesn't fire. I am expeting that when new item is added then first ItemAdding fires (which is working) and then ItemUpdated is fired (which is not working).

ItemUpdated only fires after item has been created and then I manually edit record.

public override void ItemAdding(SPItemEventProperties properties)
{
   if (properties.ListTitle == "MyList")
   {
      base.ItemAdding(properties);
      properties.AfterProperties["Department"] = "Information Technology";
   }
}

public override void ItemUpdated(SPItemEventProperties properties)
{
   //some code here
}

In elements.xml file I have written following for both events but no luck. Even if I remove this line then it still doesn't work.

<Synchronization>Synchronous</Synchronization>

How to fix this issue?

1 Answer 1

0

There is a good chance that one of these is true:

  • New solution was not deployed correctly
  • The event receive is not registered correctly

The first step is to conirm that you have event receiver registered. To do it:

enter image description here

  • Click Find current web
  • Locate EventReceivers for your list/library

enter image description here

  • Verify that A) Event receiver exinsts and B) It has correct Synchronization type

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.