Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Can the ItemAdding event be used in a Sandbox?

I need to perform a task when a Item is a added/adding, it has to be synchronous (item added is async so i cant use that).

If i cant use the ItemAdding what other options do i have?

share|improve this question
add comment

2 Answers

up vote 3 down vote accepted

Yes, it is possible (see here too http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spitemeventreceiver.itemadded(v=office.14).aspx), however you would need to be aware of some tips, such as:

  • make sure you don't use any RunsAsPrivilegedUser
  • debugging always by attaching to SPUCWorkerProcess
share|improve this answer
add comment

I don't know the answer about using ItemAdding in Sandbox (although my guess would be yes), but another option you have is to change ItemAdded to be synchronous.

Here are a couple posts about that:

http://blogs.msdn.com/b/unsharepoint/archive/2010/11/10/sharepoint-event-receivers-making-asynchronous-event-synchronous-to-avoid-save-conflict-error.aspx

http://wineya.blogspot.com/2010/03/binding-asynchronous-event-handlers-as.html

share|improve this answer
add comment

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.