If you have read one of my previous post about deploying Web Part to Office 365 you may wonder if Web Part are the only custom development that can be deployed in Office 365… The answer is no….
Let’s have a look at deploying an event receiver.
Just create an empty project :
choose SandBox in order to deploy to Office 365… if you don’t do that it won’t deploy….
Note that in the URL, I have my SharePoint Online address in the screenshot but it doesn’t seem to work when you deploy. Instead you have to do it localy (ensure that User Code service is started !):
Create a new Event Receiver
enter some code…
public override void ItemAdding(SPItemEventProperties properties)
{
properties.AfterProperties["Title"] = "Changed by event receiver at" + DateTime.Now.TimeOfDay.ToString();
base.ItemAdding(properties);
}
Then build the .wsp.
Last step, go to the solution part in your SharePoint Online :
Then activate the solution
Then create a new item in a list based on the template that you have choosen when you created the event receiver and watch for the change