Partager via


OnSyncSave Method

Topic Last Modified: 2006-06-13

Called by a store event source when an item is being saved.

Applies To

IExStoreSyncEvents Interface

Type Library

EXOLEDB Type Library

DLL Implemented In

EXOLEDB.DLL

Syntax

Sub OnSyncSave(    pEventInfo As IExStoreEventInfo,
        bstrURLItem As String,
        lFlags As LONG)
HRESULT OnSyncSave
(
        IExStoreEventInfo* pEventInfo,
        BSTR bstrURLItem,
        LONG lFlags
);

Parameters

  • pEventInfo
    A pointer to an IExStoreEventInfo interface that can be used to obtain further information related to the event.
  • bstrURLItem
    A string containing the URL of the item on which the event is occurring. This value is only valid if OLEDB or Distributed Authoring and Versioning (DAV) created the item; that is if the client set has the property PR_URL_COMP_NAME.
  • lFlags
    The following (bitwise AND) flags can give you further information about the save event. You can also use hexidecimal equivalents of the decimal values.

    Decimal Value C++ Enum Equivalent Meaning

    1

    EVT_NEW_ITEM

    The item being saved is new.

    2

    EVT_IS_COLLECTION

    The item being saved is a collection.

    4

    EVT_REPLICATED_ITEM

    The item is being saved as a result of replication.

    8

    EVT_IS_DELIVERED

    The item is being saved as the result of message delivery.

    64

    EVT_INITNEW

    This flag is set at the first firing of the event sink. (Useful for initialization purposes. It is set only once during the lifetime of a created event sink.)

    256

    EVT_MOVE

    The item being saved is being moved.

    512

    EVT_COPY

    The item being saved is being copied.

    1024

    EVT_DRAFT_CREATE

    The item being saved is a newly created draft.

    2048

    EVT_DRAFT_SAVE

    The item being saved is a draft.

    4096

    EVT_DRAFT_CHECKIN

    The item being saved is a draft check-in.

    16777216

    EVT_SYNC_BEGIN

    Synchronous begin event.

    33554432

    EVT_SYNC_COMMITTED

    Synchronous committed event.

    67108864

    EVT_SYNC_ABORTED

    Synchronous aborted event.

    536870912

    EVT_INVALID_SOURCE_URL

    The Source URL could not be obtained during a move operation.

    1073741824

    EVT_INVALID_URL

    The URL passed to the sink is invalid.

    2147483648

    EVT_ERROR

    An error occurred in the event.

Return Value

Returns S_OK if successful, or an error value otherwise.

Registration Properties

To register for this event, you need to set the registration item's EventMethod Field property to "OnSyncSave" (C++ constant = EVT_ON_SYNC_SAVE).

This event supports the following properties of Event Registration Items:

Criteria Field

Enabled Field

EventMethod Field

MatchScope Field

Priority Field

ScriptUrl Field

SinkClass Field

See Event Registration Items for more information about registration properties.

Remarks

This event is fired prior to the item being saved. This event is fired when a new item enters the store, when an existing item is saved, and when an item is moved or copied. This event does not fire when the item's parent folder is moved or copied.

Aborting the transaction associated with this event will cause the item to not be saved. If the event fired as a result of a move, aborting the transaction will abort the entire move; the original item will not be deleted and the new item will not be saved.

Synchronous events are always called twice, once for the transaction and once for the commit or abort action. See Synchronous Event Methods for more information.