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 Answer 1

1

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.

2
  • I don't quite understand. Could you elaborate on this? Jul 16, 2009 at 11:45
  • 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
    Jul 17, 2009 at 15:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.