SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am sending a variety of notifications via

SP.UI.Notify.addNotification("blah", true);

setting the "sticky bit" to true so that the notification stays visible. When I display a second notification, I want to remove the current notification, but I need the id of the notification to remove it with


Is there any way to remove all of the current notifications or to get the ids of the the current notifications?

share|improve this question
up vote 3 down vote accepted

I had the same requirement as you on my last project and used the same approach that you did:

[Edit- moved from within question]

var currentNotificationID = "";

function replaceNotification(message) {

    if(currentNotificationID != "") {

    currentNotificationID = SP.UI.Notify.addNotification(message, true);


function showError() {

    replaceNotification('Error message...');


[End Edit]

The API doesn't offer the method you're looking for on the SP.UI.Notify class.

It does however offer this method on the SP.UI.Status class:


Would this be an acceptable alternative? Click Here for more MSDN documentation on the SP.UI.Status class.

share|improve this answer
I was asked to use Notify over Status, but the above worked well enough for what I needed. I added this solution to your answer and will mark accepted once my edit gets peer reviewed. Feel free to change it. – xdhmoore Nov 23 '11 at 18:28

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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