Keep it Simple

// practice, the distance between dream and achievement

Tag: Event Receivers

SPContext.Current is NULL

There is no SPContext in following contexts:

  • Console Application/Windows application running on your server.
  • Timer Jobs
  • Event Receivers

Continue reading

SharePoint – which process do event receivers run under?

An event receiver runs in the same process as the code that triggered it. This can be anything running SharePoint code:

  • If the action (adding an item, updating an item…) is performed by an and-user, from the browser UI, the code that actually performs the operation runs under W3WP (the IIS application pool process, i.e. the one that runs the Web application).
  • If the action is done by a job, it’s under OWSTIMER.exe (the SharePoint timer service).
  • If you add an item through PowerShell, the process is PowerShell.exe. The event receiver DLL is loaded in PowerShell.exe.
  • If you add an item from a custom .exe (built on top of server Object Model), the ER will run in that exe.

Continue reading

SharePoint – Email Event Receiver for a SharePoint List

We had a requirement recently whereby we needed to process the Inbound Email before it gets stored on the SharePoint list that would accept incoming emails.

Initially, I was very optimistic that there should be articles that would explain the SPEmailEventReceiver in detail. Unfortunately I was wrong so I decided to share some of my experiences on this field.

Before creating the receiver, it is important to configure the incoming mail feature on your system. There are several excellent documents on the web that describes the Incoming Email configuration for SharePoint.

Continue reading

SharePoint – Event Receiver

While developing any application we need to handle some events. For example, when a new item is added to a list, we may need to perform some action like say, notifying the person who created the list item, or modifying the dependent entries in some other location etc. Handling of such events is facilitated by event receivers. We have many SharePoint event receiver classes in order to handle variety of events.

Continue reading

© 2017 Keep it Simple

Theme by Anders NorenUp ↑