5

I create a web.

I create a doc library within this web.

Create folders within this doc library.

Then 'subscribe' (i.e. create an alert for) a user for this doc library.

Why, if I'm doing things in this order, is the user being notified of the doc library sub folders being created? They shouldn't know about an event that happened prior to the alert being created I'd assume?

2 Answers 2

16
+150

Immediate Alerts timer job "Sends out immediate and scheduled alerts." the documentation says. However, immediate is controlled by a timer job which runs every five minutes by default. So in your case - the possible series of actions is:

  1. Create folder
  2. Create alert

Now these two actions happened within the same 5 minute period, and when the timer job fires it checks "What has been changed the last five minutes" and "Who should be notified". Matching those two you'll get a notification e-mail even if the alert was created after the folders.

Reference: Timer job reference (SharePoint Server 2010)

3
  • 1
    Thanks very much Benny, a big help in understanding this behaviour. I would look down the route of 'postponing' the creation of an alert by 5 minutes or more through the user of a bespoke timer job but I have to assume that a user may start uploading documents to this particular list within minutes. I think the filter may be the way for me to go with this. Commented Feb 18, 2013 at 13:16
  • Just to sound real desperate - do you have any idea on my issue with the alert filter please Benny? sharepoint.stackexchange.com/questions/59856/…‌​er-alert-against-a-list Commented Feb 18, 2013 at 13:18
  • 3
    Bounty awarded. Suppose sometimes it's well worth 150 points just to get a grip on an understanding of SharePoint's 'under the bonnet' concepts. Thanks again. Commented Feb 18, 2013 at 13:27
4

You can filter folders from alerts, but it's a little tricky. Here's how I've managed to accomplish it.

First, create a custom content type based on the Folder content type (I named it "Managed Folder" in this case). Add that to any lists you want to be affected and make sure it is visible in the "New" button. Remove folder creation from the list in its advanced settings. Now create a view of the library that filters out content type "Managed Folder" (this is where you need the custom content type, using the standard Folder type will make the next part impossible). Now you can set alerts to apply only to items that show up in that specific view. Users can use the "New" button in the library to make "Managed Folders" which don't show up in the view, and therefore don't trigger the alerts.

Protip: Find the GUID of the view using SP Manager or PS or whatever you like, then use that to make a console application that recursively changes the content type of all existing folders to the new custom content type. That way if a folder is deleted or renamed or moved it will also not trigger the alerts.

Protip 2: Have a similar console app iterate through all alerts (or filtered however you like) and change them to be based on that view. This is useful if users are permitted to create their own alerts. I'm sure it could be done automatically with an event receiver too, though I have not done that part myself.

Bonus: Having the folders set to the custom content type allows you to add metadata and gives you much more control over them.

Edit: Here's the detailed explanation/solution for the alert view problem - SPv4 Alert Views

3
  • 1
    +1 for this answer. Really appreciate the time you've taken to write it out. It seems hugely elaborate for such filtering though. The folder content type itself is identifiable but it just seems impossible to filter on it? Did you explore all other avenues first? Commented Feb 18, 2013 at 15:43
  • @DeeMac Yeah believe me, it's that elaborate because there no easier way to do it, but when it's all said and done having control over the folder's metadata is pretty valuable. I learned the hard way that views based on certain default content types (like Folder) cannot be used in an alert, hence creating a cloned custom content type. I almost went mad trying to figure out why only some views showed up as options in alerts. Check out the link I just added to my answer.
    – thanby
    Commented Feb 18, 2013 at 16:08
  • Thanks so much Thanby, really appreciate that. I'll have a good read of it. Commented Feb 18, 2013 at 16:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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