Thursday, November 05, 2009

SharePoint 2010 Events

SharePoint 2010 introduces a number of different event receivers that developers can take advantage of.

There are 5 types of events which can be captured:
1. List Events
2. List Item Events
3. List Email Events
4. Web Events
5. List Workflow Events

After events can now be synchronous (Before events are synchronous and After events are asynchronous by default).

Visual Studio 2010 provides Event Receiver template. It will help developers quickly jumpstart the process.






The list of events is given below.

SPListEventReceiver: Provides methods to trap events that occur for lists.

ListAdded : Event that occurs after a list is added to a Web site.
ListAdding : This event is registered at the Web site or site collection where the list is created.
ListDeleting : Event that occurs before a list is deleted.
ListDeleted : Event that occurs after a list is added to a Web site.
FieldAdded : Occurs after a field link is added.
FieldAdding : Occurs when a field link is being added to a content type.
FieldDeleted : Occurs after a field has been removed from the list.
FieldDeleting : Occurs when a field is in the process of being removed from the list.
FieldUpdated : Occurs after a field link has been updated
FieldUpdating : Occurs when a field link is being updated


SPItemEventReceiver: Provides methods for trapping events that occur to items.

ItemAdded : Asynchronous After event that occurs after a new item has been added to its containing object.
ItemAdding : Synchronous Before event that occurs when a new item is added to its containing object.
ItemAttachmentAdded : Asynchronous After event that occurs after a user adds an attachment to an item.
ItemAttachmentAdding : Synchronous Before event that occurs when a user adds an attachment to an item.

ItemAttachmentDeleted : Asynchronous After event that occurs when after a user removes an attachment from an item.

ItemAttachmentDeleting : Synchronous Before event that occurs when a user removes an attachment from an item.

ItemCheckedIn : Asynchronous After event that occurs after an item is checked in.
ItemCheckedOut : Asynchronous After event that occurs after an item is checked out.
ItemCheckingIn : Synchronous Before event that occurs as a file is being checked in.
ItemCheckingOut : Synchronous Before event that occurs after an item is checked out.
ItemDeleted : Asynchronous After event that occurs after an existing item is completely deleted.
ItemDeleting : Synchronous Before event that occurs before an existing item is completely deleted.

ItemFileConverted

ItemFileMoved : Occurs after a file is moved.
ItemFileMoving : Occurs when a file is being moved.
ItemUncheckedOut : Synchronous Before event that occurs when an item is being unchecked out.
ItemUncheckingOut : Synchronous Before event that occurs when an item is being unchecked out.

ItemUpdated : Asynchronous After event that occurs after an existing item is changed, for example, when the user changes data in one or more fields.

ItemUpdating : Synchronous Before event that occurs when an existing item is changed, for example, when the user changes data in one or more fields.


SPWebEventReceiver: Provides methods for trapping events that occur to Web sites.

SiteDeleted : Occurs after a site collection has been deleted.
SiteDeleting : Occurs when a site collection is being deleted.
WebDeleted : Asynchronous After event that occurs after an existing Web site is completely deleted.
WebDeleting : Synchronous Before event that occurs before an existing Web site is completely deleted.
WebMoved : Asynchronous After event that occurs after an existing Web site has been moved.

WebMoving : Synchronous Before event that occurs before an existing Web site has been renamed or moved to a different parent object.

WebAdding : Synchronous Before event that occurs before a new Web site is created.

WebProvisioned : Synchronous After event that fires after the Web is fully provisioned and the provisioning process has stopped.


SPEmailEventReceiver: Provides a method for trapping the event when a list receives an e-mail message.

EmailReceived : Occurs after an e-mail message has arrived.


SPWorkflowEventReceiver:

WorkflowCompleted : A workflow was completed
WorkflowPostponed : A workflow was postponed
WorkflowStarted : A workflow was started
WorkflowStarting : A workflow is starting
Note: This documentation is preliminary and is subject to change.

No comments: