Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.
using System;
using System.Security.Permissions;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Security;
using Microsoft.SharePoint.Utilities;
using Microsoft.SharePoint.Workflow;

namespace Change_Title_Event.Change_Title
{
    /// <summary>
    /// List Item Events
    /// </summary>
    public class Change_Title : SPItemEventReceiver
    {
       /// <summary>
       /// An item is being added.
       /// </summary>
       public override void ItemAdding(SPItemEventProperties properties)
       {
           properties.AfterProperties["Title"] = "Kevin: Changed by event receiver at" + DateTime.Now.TimeOfDay.ToString();
           base.ItemAdding(properties);
       }


    }
}

Where simple example, which works perfect on my local Sharepoint 2010. It is sandboxed.

But when I package this solution, it do not work on Sharepoint Online. I does not give any Errors either.

I think I am doing something wrong, something simple, but I can't simply find anything on Google about it.

Here is another who asks on the MSDN forum, but gets a very wierd reply, that I do not understand. http://community.office365.com/en-us/forums/153/t/48868.aspx

share|improve this question
    
Microsoft have also an example here, but that do not work either. I am using it with a annoncement list, but it do not add anything to the body. code.msdn.microsoft.com/office/… –  Kevin Simper Jul 17 '12 at 13:32

4 Answers 4

up vote 0 down vote accepted

It is because you have to activate two times.

Both in the solution page and the you have to go to the Feature page and activate the feature.

// I was confused because normally you only have to activate once.

share|improve this answer
    
In my case it is activated in both places, and the receiver is still not working on online (on premises works fine, though). –  Renan May 29 '13 at 19:27
    
Sandbox solution is activated once. –  Milen Aug 25 at 12:43

It is because you have to activate two times.

Both in the solution page and the you have to go to the Feature page and activate the feature.

check this post: Why does my Event Receiver (sandboxed) not work on Sharepoint Online, but works perfect on premise

http://community.office365.com/en-us/forums/154/t/60731.aspx

share|improve this answer
    
I have activated the feature correctly. It is activated on the solution gallery AND the Site Feature Activation. –  ChiliYago Mar 9 '14 at 13:59

Sandbox solution should be activated first.

Then there must be one of many Features part of the solution referencing objects, events, etc. contained in the solution. Activating this feature will deliver all items as specified in it.

share|improve this answer

Sandbox solutions has been deprecated using custom code. Please check the below link http://blogs.msdn.com/b/sharepointdev/archive/2014/01/14/deprecation-of-custom-code-in-sandboxed-solutions.aspx

May be that is reason your event receiver is not working.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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