views:

459

answers:

1

BY now I've created a number of custom alert handlers for SharePoint 2007 using the IAlertNotifyHandler interface. Using this interface you have to implement a method called OnNotification(), which has the following signature:

bool OnNotification (SPAlertHandlerParams ahp);

As you can see this method should return a boolean value. The official MSDN docs list the following explanation of this return value:

true if Windows SharePoint Services marks the notification as processed; otherwise false

At first I thought this meant that if you return true you signal SharePoint that your handler has done all alert processing and SharePoint shouldn't execute its default behaviour. However, in practice there doesn't seem to be any difference in the way the alerts are handled. You can return true or false, it doesn't make any difference.

I then used Reflector to dissassemble the source code, but unfortunately the code that processes OnNotification's return value isn't managed, but native.

So who knows what that return value means?

+1  A: 

I believe this is only considered in the case of Digest alerts (Daily or Weekly summaries) and not for Immediate alerts. If you return false when handling a summary alert, the same items will be sent to the user in the next summary alert.

glenc
I don't quite understand. Could you elaborate on this?
LeonZandman
Let's say you have a daily alert that is notifying you about one new item: "Item 1". If you return false from your handler, the next time that daily alert fires, it will still have "Item 1" in the body thus the user will receive another alert for the same item.I am not 100% positive about this, but I did observe this behavior when working on a recent project. After returning true from the OnNotification method, I stopped receiving the duplicates.
glenc