Skip to Main Content
Essential SharePoint
book

Essential SharePoint

by Jeff Webb
May 2005
Beginner content levelBeginner
336 pages
10h 14m
English
O'Reilly Media, Inc.
Content preview from Essential SharePoint

Responding to Events

Chapter 5 showed how to create email alerts that notify you when a document changes. Email alerts are sent for several general types of changes. You can also respond to changes by enabling an event handler for the library. Event handlers are code blocks activated by specific occurrences, enabling you to respond to specific changes, such as document approval or rejection, and create a response that is more complex than sending email.

Event handlers are written by programmers. As a member, you need to know how they work and how to enable them for your library. Event handlers can respond to these types of events:

  • Cancelling check-out

  • Checking in

  • Checking out

  • Copying

    Creating a new member group that can approve/reject documents

    Figure 6-16. Creating a new member group that can approve/reject documents

  • Deleting

  • Moving or Renaming

  • Updating

When an event occurs in the document library, SharePoint calls the event handler DLL and provides an SPListEvent object that includes the type of event, the document that changed, and the properties of the document before and after the change. The code in the DLL uses that information to decide what to do. For example, your company might use an event handler to send notification to a vendor when an invoice is approved. Figure 6-17 shows how the process would work.

Using an event handler to notify a vendor

Figure 6-17. Using an event handler to notify ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

SharePoint User's Guide

SharePoint User's Guide

Infusion Development Corp. (Infusion Development Corporation)
Beginning SharePoint® 2010: Building Business Solutions with SharePoint

Beginning SharePoint® 2010: Building Business Solutions with SharePoint

Amanda Perran, Shane Perran, Jennifer Mason, Laura Rogers

Publisher Resources

ISBN: 0596008805Errata Page