Skip to main content
Blogging about SharePoint

Blogging about SharePoint

Blogging about SharePoint
Public Speaking
Michael Blumenthal's BlumenthalIT.NET > Blogging about SharePoint > Posts > Which views can be used when Creating an Alert ?  

December 27
Which views can be used when Creating an Alert ?

When you create an alert on a list, you have the option of specifying a view which limits which items would trigger the alert.


Note however that the list of views you can choose from is a subset of the views available on the list.  In fact, if you don't have any views that are ok to use for alerts, you won't even see the option to select a view.

What are the rules that determine which views are available for use?

Experimentally, my guesses are:

1) It must have a where clause.  All Items views don't show up in the list of views, and it's pointless to use an All Items view because it doesn't filter.

2) It must be a public view, it cannot be a personal view.

3) It cannot involve content approval.

To try to substantiate these guesses, I went to the source with .NET Reflector (

The page to create a new alert is _layouts/subnew.aspx.

Its code-behind is the SubNewPage in the Microsoft.SharePoint.ApplicationPages dll.  This is in Inetpub\wwwrooot\wss\virtualDirectories\<dir for the web app>\app_bin.

You need to open it in Reflector.  Some of the other SharePoint DLL's are in the GAC, so you may need to copy those DLL's out of the GAC into a more accessible place.  To get a dll out of the GAC, use the command prompt to look around c:\windows\assembly rather than windows explorer.  My copy of the Microsoft.SharePoint.dll and Microsoft.SharePoint.Library.dll was c:\windows\assembly\GAC_MSIL\<dll name without extension>/<version number>_<public key token>/


Once you have the ApplicationPages DLL open in Reflector, find the SubNewPage class.  Note It inherits from SubNewEditBasePage, so we now look at that base class because SubNewPage doesn't do anything specific to the list of views. 

Within SubNewEditBasePage, there is an InitForm method that walks through the views for the current list, and only adds to the drop down list the views it likes.


The code here is a little hard to understand due to the goto's, but some of the details we can pick out are a qualified view is added to the drop down list box in section 58B and that that in order for the view to be listed:

  1. The view cannot have its Hidden property true.  Checked within the 56A section.
  2. The view must have a title - probably the nameless views used by certain list viewing web parts do not (a guess).  Title is checked within the 57B section.
  3. The view must have a where clause.  This is checked in the 5F7 section.  Let's look at GetFilter more closely.


Here we can see that if v.Query is not null (which I interpret as "if there is a where clause") and the query does not use the DateRangesOverlap tag, then we can consider the view further, for possible inclusion in the drop down list.

The next thing it does of significance is to call ValidateFilter on the where clause XML. 


This is a thin wrapper around ParentWeb.Request.ValidateSubscriptionFilter.


Uh oh, it looks like we are getting into unmanaged (non-.NET) code.  Sure enough, this is where we hit the wall:


We can't look inside this with .NET Reflector, so this is the end of the line.  If anyone else has information on what the rules are for which views can be used in alerts, please leave a comment.



nice digging

Great sleuthing skills. Thanks for sharing the techniques and the results. Who knew? A shame this isn't in the official dogs.
Tom Resing
Tom Resing's SharePoint Blog
 on 12/28/2008 11:29 AM


We found that if we created a view based off an existing view it would not show up.  If we created it new of off a standard view template, it would show up in the list of views to select from for alert.

Interesting, but not sure why this is the case when the original view we cloned does show up in the drop down...
 on 5/21/2009 11:59 AM

Personal views can

Yes personal views can be used.

No all though, but that must be influenced by the same rules as the other ones (that we don't know at full).
 on 8/25/2009 3:25 AM

Nice! Wish I found this earlier!

Thanks for the post.  This helped me resolve an issue I was having with a programmatically created view not showing up in the New Alerts View drop down list.

Here's what happened to me:
The SPAlert object is the key to creating alerts programmatically.

Note that SPAlert has a .Filter property that can be used to set the CAML for which items generate the alert.  I'm guessing this is what is used to set the alert to work with a view.

     I recently had an issue where I was programmatically adding views to a list and the views wouldn't show up in the New Alert page ([Your web]/_layouts/SubNew.aspx?List=[GUID of list]).  Where it says, "Send Alerts for these Changes" and "Someone changes an item that appears in the following view," the item wouldn't show up in the drop down list.

This blog entry actually has the closest clue to resolving this.

The view.Query had a FieldRef as below:


<Eq><FieldRef Name="FieldName" /><Value Type="Choice">Some Choice Value</Value></Eq>


I found a work around was to modify the view and save it using the GUI.  The view would then show up in the drop down list.

Further investigation showed that the GUI changed the query, as follows:


<Eq><FieldRef Name="FieldName" /><Value Type="Text">Some Choice Value</Value></Eq>


Changing the Value Type from "Choice" to "Text" fixed my issue!  I guess you can only have certain Value Types in the FieldRef section of your CAML.

 on 1/30/2011 8:34 PM


Looking for info to solve that problem, thi is the only blog i´ve found and I think it´s very usefull information.
thank you.
 on 7/12/2012 8:35 AM

Number of filters

We can add that number or lentgh of filter can be a problem. I put the finger on that. When I put too many filter criterias the view is not available in alert window. When I delete one or two filter criterias on the view, I can see it again when I create an alert.
 on 10/30/2014 3:56 AM

Alert on Custom view

I created a view that filters a date field to be equal to or less than [Today].  When an existing item's date meets that criteria, it shows on the view and I want to be alerted on it.  Although I thought I used this in this content for the last 4 years, now I cannot get it to send the alert when the item goes onto the view.  Any ideas to solve this?
 on 3/19/2015 11:56 AM

 on 4/1/2015 12:15 AM

Re: Which views can be used when Creating an Alert ?
 on 4/20/2015 8:37 PM

Re: Which views can be used when Creating an Alert ?

 on 4/28/2015 3:59 AM
1 - 10Next

Add Comment

Items on this list require content approval. Your submission will not appear in public views until approved by someone with proper rights. More information on content approval.


Body *

Please put your name at the end of your comment as the Name field doesn't display in the main view of the comments.

Name: *

Your name.  If you first name is Michael, please provide initials or the like to clearly distinguish your name from Michael Blumenthal's.
Also, this field does not appear in the main view of the comments.

Need Paid Consulting Services?

Are you interested in engaging a SharePoint consultant for fee-based consulting services?  If so, I can have an Account Executive from my employer contact you.  Other site visitors will not see this column.

Additional Contact Information

Please provide additional contact information if you need a direct response.  Other site visitors will not see this column.

What is tomorrow's date? *

Select a date from the calendar.
This is a weak CAPTCHA based on advice from a tweet from @ToddKlindt.