Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

ItemUpdated in Tasks list firing twice

$
0
0

I have an event receiver - ItemUpdated - that is attached to my task list and is firing twice.

The event receiver only checks if item["Status"] == "Completed" then it will just send an email notification.

As you can see it doesnt update the same item. it just gets the value of the Status column.

However when I debug it, it triggers the ItemUpdated at random parts of the code.

I also checked how many eventreceivers are attached in the list and its only ONE(1)

I have also specified the event receiver to be attached to my Task list in the Elements.xml.

I also did this but still no luck

this.EventFiringEnabled = false;
            if (properties.Web.ID.ToString().Equals(Constants.webId))
            {
                SPListItem task = properties.ListItem;
                if (Convert.ToString(task["Status"]) == "Completed")
                { 
//send email
}
}
this.EventFiringEnabled = true;


----------------------- Sharepoint Newbie


Viewing all articles
Browse latest Browse all 11571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>