views:

140

answers:

1

According to many blogs on the internet when creating a SharePoint alert (SPAlert) from code you have to specify values for both the EventType and the EventTypeBitmask. However, I cannot find any explanation about the values of EventTypeBitmask. I created some alerts using the SharePoint web GUI and inspected the EventTypeBitmask values of the created alerts. But they don't seem to make much sense.

Does anybody know which values should be used?

A: 

With the help of Reflector, the recognised values for EventTypeBitmask are defined by this enum:

public enum AlertChangeType
{
    Discovered = 1,
    Modified = 2
}

According to the documentation, the behaviour is All (0xffffffff) if not specified.

As this enum is undocumented, derive from it what you can. My guess is that Discovered means new items and Modified means changed items.

Alex Angas
Nice find! I somehow missed this. However AlertChangeType values seem to be used for search alerts only. I doubt this is the whole story...
LeonZandman
From what I could tell in Reflector, SharePoint only cares about if the value is 1 or 2.
Alex Angas