3
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

1

4 Answers 4

0

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.

2
  • In my case it is activated in both places, and the receiver is still not working on online (on premises works fine, though).
    – Geeky Guy
    May 29, 2013 at 19:27
  • Sandbox solution is activated once.
    – Milen
    Aug 25, 2015 at 12:43
0

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

1
  • I have activated the feature correctly. It is activated on the solution gallery AND the Site Feature Activation.
    – ChiliYago
    Mar 9, 2014 at 13:59
0

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.

-1

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.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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