I have this code where only ItemAdding is firing when I add new item in the list but ItemUpdated doesn't fire. I am expecting 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>
Environment is SharePoint 2016. How to fix this issue?