Posts

Showing posts with the label event receiver

Sharepoint 2010: BeforeProperties and AfterProperties in Event Receivers!

Event Receiver is a great feature for Sharepoint 2010, but I spent many time to discover how Properties works.. Especially BeforeProperties and AfterProperties.. I found a great post with resume all available values. Here table and below the link! http://www.synergyonline.com/Blog/Lists/Posts/Post.aspx?ID=122 These are the values of the properties in  List  events: List BeforeProperties AfterProperties properties.ListItem ItemAdding No Value New Value Null ItemAdded No Value New Value New Value ItemUpdating No Value Changed Value Original Value ItemUpdated No Value Changed Value Changed Value ItemDeleting No Value No Value Original Value ItemDeleted No Value No Value Null And here are the properties available in  Library  events: Library BeforeProperties AfterProperties properties.ListItem ItemAdding No Value No Value Null ItemAdded No Value No Value New Value ItemUpdating Original Value Changed Value Original Value ItemUpdated Ori...

Sharepoint 2010 - Email Event Receiver Issues

Image
The Email event receiver is not so simple to create and execute... I experienced some issues for the correct configuration. EmailReceived Method: wrong reference in Handle Email Receiver method created by VS When you create the email event receiver you see the method EmailReceived. In Visual Studio, see properties of event receiver and you see "handle email receiver" = false. If you set to true, VS creates method EmailReceiver with Microsoft.Sharepoint.SPEmailMessage insthead of Microsoft.Sharepoint.Utilities.SPEmailMessage. This cause error in build event receiver. I think is an issue/bug of Sharepoint 2010, but I did not found any documentation in MS. Solution : The event receiver work fine without set "handle" property to true. Leave this setting to false. Email Event Receiver: SPContext.Current is null Solution : use list.ParentWeb, from the list property of method EmailReceived. Email Event Receiver: if you have to process attachment of email If y...