|
1 | 1 | ---
|
2 | 2 | title: Sandbox solution transformation guidance - Event receivers
|
3 |
| -ms.date: 11/03/2017 |
| 3 | +description: Identify options and strategies for replacing existing event receivers from your sandbox solutions. |
| 4 | +ms.date: 5/4/2018 |
4 | 5 | ---
|
5 |
| -# Sandbox solution transformation guidance - Event receivers |
6 |
| -This article will help you to identify options and strategies on replacing existing event receivers from your sandbox solutions. |
7 | 6 |
|
8 |
| -_**Applies to:** Add-ins for SharePoint | SharePoint 2013 | SharePoint 2016 | SharePoint Online_ |
| 7 | +# Sandbox solution transformation guidance - Event receivers |
9 | 8 |
|
10 |
| -Code-based sandbox solutions [were deprecated](https://blogs.msdn.microsoft.com/sharepointdev/2014/01/14/deprecation-of-custom-code-in-sandboxed-solutions/) back in 2014 and SharePoint online has started the process to completely remove this capability. Code-based sandbox solutions are also deprecated in SharePoint 2013 and in SharePoint 2016. |
| 9 | +The approach you take to handle events in SharePoint is slightly different in the SharePoint Add-in model than it was with Full Trust Code or in coded-sandbox solutions. In typical previous solutions, event receivers were created using the SharePoint Server-Side Object Model and deployed via solutions packages, which executed the code on the SharePoint servers. |
11 | 10 |
|
12 |
| -## Summary |
| 11 | +In the SharePoint Add-in model, however, the event receiver implementation executes on the web server that is hosting the event receiver; these are called remote event receivers (RERs). Event receivers can in many cases be replaced with a remote event receiver implementation. |
13 | 12 |
|
14 |
| -The approach you take to handle events in SharePoint is slightly different in the SharePoint Add-in model than it was with Full Trust Code or in coded-sandbox solutions. In typical previous solutions, event receivers were created using the SharePoint Server Side Object Model and deployed via solutions packages, which executes the code on the SharePoint servers. In the SharePoint Add-in model; however, the event receiver implementation executes on the web server that is hosting the event receiver and these are called Remote Event Receivers (RER). Event receivers can in many cases be replaced with a remote event receiver implementation. This article describes various options and design considerations. |
| 13 | +This article describes various options and design considerations. |
15 | 14 |
|
| 15 | +> [!NOTE] |
| 16 | +> [Code-based sandbox solutions were deprecated](https://blogs.msdn.microsoft.com/sharepointdev/2014/01/14/deprecation-of-custom-code-in-sandboxed-solutions/) in 2014, and SharePoint Online has started the process to completely remove this capability. Code-based sandbox solutions are also deprecated in SharePoint 2013 and in SharePoint 2016. |
16 | 17 |
|
17 |
| -## Options for replacing Event Receivers |
18 |
| -<a name="sectionSection2"> </a> |
| 18 | +## Options for replacing event receivers |
19 | 19 |
|
20 |
| -|**Approach**|**Additional Information**| |
| 20 | +|Approach|More information| |
21 | 21 | |:-----|:-----|
|
22 |
| -|Remote Event Receiver|</p><lu><li>[Use remote event receivers in SharePoint](https://msdn.microsoft.com/en-us/pnp_articles/use-remote-event-receivers-in-sharepoint)</li><li>[How to use remote event receivers for your SharePoint add-ins](https://channel9.msdn.com/blogs/OfficeDevPnP/How-to-use-remote-event-receivers-for-your-SharePoint-add-ins)</li><li>[Event receivers and list event receivers in the SharePoint Add-in model](https://msdn.microsoft.com/en-us/pnp_articles/event-receiver-and-list-event-receiver-sharepoint-add-in)</li></lu><li>[Auto tagging sample add-in for SharePoint](https://msdn.microsoft.com/en-us/pnp_articles/autotagging-sample-app-for-sharepoint)</li><li>[Handle events in SharePoint Add-ins](https://msdn.microsoft.com/en-us/library/office/jj220048.aspx)</li></lu></p>| |
23 |
| -|WebHooks|<p>WebHooks for SharePoint are still under development and will be available for preview soon.<lu><li>[Introducing SharePoint WebHooks](http://dev.office.com/blogs/introducing-sharepoint-webhooks)</li></p> |
24 |
| -|Remote Timer Job to monitor changes|<p>Use the **ChangeQuery** object to monitor a site or list for modifications. This pattern is an alternative to Remote Event Receivers<lu><li>[SharePoint List Item Change Monitor](https://github.com/SharePoint/PnP/tree/master/Samples/Core.ListItemChangeMonitor)</li><li>[Remote Timer Job Pattern](https://github.com/SharePoint/PnP/tree/master/Samples/Core.SimpleTimerJob)</p>| |
25 |
| - |
26 |
| -## Design Considerations |
27 |
| -### Remote Event Receivers |
28 |
| -- Requires hosting infrastructure |
29 |
| -- Hosting infrastructure must be highly available |
30 |
| -- The service endpoint that hosts the remote event receiver must be configured for anonymous authentication |
31 |
| -- Requires a trusted 3rd Party certificate if you are using SharePoint Online |
32 |
| -- Not intended for long running operations |
33 |
| -- Remote Event Receivers that are attached out-side the context of add-in, attached using a console application or PowerShell; will not receive a SharePoint context token when invoked and you must differ to app-only permissions or use the SharePointOnlineCredentials class |
34 |
| -- There is no retry mechanism |
35 |
| - |
36 |
| -### WebHooks |
37 |
| -- Requires hosting infrastructure |
38 |
| -- Hosting infrastructure must be highly available |
39 |
| -- Does not support synchronous events |
40 |
| -- Process changes after the event has occurred |
41 |
| -- Public preview available in summer 2016 for SharePoint Online |
| 22 | +|Remote event receiver|<ul><li>[Use remote event receivers in SharePoint](use-remote-event-receivers-in-sharepoint.md)</li><li>[How to use remote event receivers for your SharePoint Add-ins](https://channel9.msdn.com/blogs/OfficeDevPnP/How-to-use-remote-event-receivers-for-your-SharePoint-add-ins)</li><li>[Event receivers and list event receivers in the SharePoint Add-in model](event-receiver-and-list-event-receiver-sharepoint-add-in.md)</li><li>[Auto-tagging sample SharePoint Add-in](autotagging-sample-app-for-sharepoint.md)</li><li>[Handle events in SharePoint Add-ins](../sp-add-ins/handle-events-in-sharepoint-add-ins.md)</li></ul>| |
| 23 | +|Webhooks|<ul><li>[Overview of SharePoint webhooks](/apis/webhooks/overview-sharepoint-webhooks)</li><li>[Introducing SharePoint Webhooks](https://dev.office.com/blogs/introducing-sharepoint-webhooks)</li></ul> |
| 24 | +|Remote timer job to monitor changes|<p>Use the **ChangeQuery** object to monitor a site or list for modifications. This pattern is an alternative to remote event receivers.<ul><li>[SharePoint List Item Change Monitor](https://github.com/SharePoint/PnP/tree/master/Samples/Core.ListItemChangeMonitor)</li><li>[Remote Timer Job Pattern](https://github.com/SharePoint/PnP/tree/master/Samples/Core.SimpleTimerJob)</ul></p>| |
| 25 | + |
| 26 | +## Design considerations |
| 27 | + |
| 28 | +### Remote event receivers |
| 29 | + |
| 30 | +- Require hosting infrastructure. |
| 31 | +- Hosting infrastructure must be highly available. |
| 32 | +- The service endpoint that hosts the remote event receiver must be configured for anonymous authentication. |
| 33 | +- Requires a trusted third-party certificate if you are using SharePoint Online. |
| 34 | +- Not intended for long running operations. |
| 35 | +- Remote event receivers that are attached outside the context of add-ins, attached by using a console application or PowerShell will not receive a SharePoint context token when invoked, and you must defer to add-in-only permissions or use the SharePointOnlineCredentials class. |
| 36 | +- There is no retry mechanism. |
| 37 | + |
| 38 | +### Webhooks |
| 39 | + |
| 40 | +- Require hosting infrastructure. |
| 41 | +- Hosting infrastructure must be highly available. |
| 42 | +- Does not support synchronous events. |
| 43 | +- Process changes after the event has occurred. |
42 | 44 | - Not available in SharePoint on-premises builds at this time.
|
43 | 45 |
|
44 |
| -### Remote Timer Job |
45 |
| -- Requires hosting infrastructure |
46 |
| -- Process changes after the event has occurred |
47 |
| -- Uses a polling mechanism to process changes |
| 46 | +### Remote timer job |
| 47 | + |
| 48 | +- Requires hosting infrastructure. |
| 49 | +- Process changes after the event has occurred. |
| 50 | +- Uses a polling mechanism to process changes. |
48 | 51 |
|
49 | 52 | ## Removing your sandbox code from your site
|
50 |
| -<a name="sectionSection3"></a> |
51 |
| -When you deactivate your existing sandbox solution from your sites, any assets or files deployed using declarative options will not be removed however, the features in the sandbox solution will automatically be deactivated and the event receiver(s) will be removed. |
| 53 | + |
| 54 | +When you deactivate your existing sandbox solution from your sites, any assets or files deployed by using declarative options are not removed. However, the features in the sandbox solution are automatically deactivated and the event receiver is removed. |
52 | 55 |
|
53 | 56 | ## See also
|
54 |
| -<a name="bk_addresources"> </a> |
55 |
| -- [Removing Code-Based Sandbox Solutions in SharePoint Online](http://dev.office.com/blogs/removing-code-based-sandbox-solutions-in-sharepoint-online) |
56 |
| -- [Sandbox solution transformation guidance](https://msdn.microsoft.com/en-us/pnp_articles/sandbox-solution-transformation-guidance) |
57 |
| -- [Remove assembly reference from your Sandbox solution created in Visual Studio](https://support.microsoft.com/en-us/kb/3183084) |
58 |
| -- [Build add-ins for SharePoint](https://msdn.microsoft.com/library/office/fp179930.aspx) |
59 |
| -- [Office 365 development and SharePoint patterns and practices solution guidance](https://msdn.microsoft.com/en-us/pnp_articles/office-365-development-patterns-and-practices-solution-guidance) |
| 57 | + |
| 58 | +- [Transform sandbox solutions to the SharePoint Add-in model](sandbox-solution-transformation-guidance.md) |
0 commit comments