Platform SDK: Exchange 2000 Server

IExStoreSyncEvents::OnSyncDelete

[This is preliminary documentation and subject to change.]

Called by store when an item is being deleted.

[Visual Basic, VBScript]
Sub OnSyncDelete(
   pEventInfo As IExStoreEventInfo,
   bstrURLItem As String, 
   lFlags As Long
   )
[C++]
HRESULT OnSyncDelete(
   IExStoreEventInfo  * pEventInfo, 
   BSTR bstrURLItem, 
   LONG lFlags
   );
[IDL]
HRESULT OnSyncDelete(
   [in] IExStoreEventInfo * pEventInfo,
   [in] BSTR bstrURLItem,
   [in] LONG lFlags
   );
pEventInfo
A pointer to an IExStoreEventInfo interface that can be used to obtain further information related to the event.
bstrURLItem
A string containing a URL to the item that will be deleted upon successful completion of all synchronous events. This item is unlocked when synchronous events have an open transaction on it.
Flags
The following (bitwise AND) flags can give you further information about the delete event
Decimal Equivalent C++ Enum Equivalent Meaning
256 EVT_MOVE The item was moved over resulting in an implicit delete.
512 EVT_COPY The item was copied over resulting in an implicit delete.
32 EVT_HARDDELETE The item has left the information store (hard delete).
16 EVT_SOFTDELETE The item has been moved to the dumpster (soft delete).
2 EVT_IS_COLLECTION The item being deleted is a collection.
33554432 EVT_SYNC_COMMITTED Synchronous committed event.
67108864 EVT_SYNC_ABORTED Synchronous aborted event.
1073741824 EVT_INVALID_URL The URL passed to the sink as invalid.
2147483648 EVT_ERROR An error occurred in the event.

Return Value

You return one of the following values:

Return Value C++ Enum Equivalent Description
S_OK S_OK Continue with the transaction
67108864 EVT_SYNC_ABORTED Abort the event

Registration Properties

To register for this event, you need to set the registration item's eventmethod property to "OnSyncDelete" (C++ constant = EVT_ON_SYNC_DELETE).

This event supports the following Registration Item properties:

Remarks

This event is fired to an item being deleted from the store, or when an item is moved in the store. This event does not fired when the item's parent folder is moved or deleted.

The OnDelete event uses the EVT_HARDDELETE and EVT_SOFTDELETE flags to distinguish between hard and soft delete. A soft delete is defined as a delete that moves an item into the dumpster (the deleted folder within each folder). A hard delete is defined as a delete in which an item is completely removed from the store.

Aborting the transaction associated with this event will prevent the item from being deleted. If you abort an event that is the result of a move, then both the save and delete steps of the move will be aborted. This means that the original item will not be deleted and the new item will not be saved.

See Synchronous Events and Synchronous Event_Details for more information.