tags:

views:

130

answers:

2

We use Sharepoint Services 3.0 as a project tracking tool. We have a list set up that contains your basic information (description, etc.) plus we have a "assigned person" column that is of type Person or Group that we use to associate list items with individuals. This column supports multiple selections.

We would like to set up alerts such that each person gets an alert email only if they are assigned to a list item. The approach we have taken is to set up a view on this list that is filtered to show list items where the assigned person equals [Me], and then to create an alert on this list that is set to send an email when someone changes an items that appears in the view.

This works well when there is only one person in the assigned person column. It does not work when there is more than one person in the assigned person column.

Does anybody know why this wouldn't work, or what I can do to troubleshoot? Is there a better way to achieve the end result? We could make several "assigned person" columns and not allow multiple selections, but that seems kind of kludgy.

A: 

The reason it works for one person but not multiple people is because the check is specifically against an individual. The comparison your view does is whether Assigned is equal to [Me], not if Assigned has [Me] as one of its entities.

Instead of using a list filter of is equal to, use the list filter contains. That should do the trick.

EDIT IN RESPONSE TO COMMENTS

To access the object model, you'll need to use Visual Studio. I'm unaware of a method to accomplish this kind of thing using SharePoint Designer, but maybe there's some sort of crazy Datasheet View thing you can do. Anyway... onto your actual needs...

The following code sample illustrates a very basic method for achieving your goal.

using (SPSite site = new SPSite("yourwebsiteurlhere")) 
{
    using (SPWeb web = site.OpenWeb())
    {
        SPList list = web.Lists["titleoflist"];
        SPView view = list.Views["filteredviewname"];
        view.Query = "<Where><Contains><FieldRef Name=\"assignfield\"/><Value Type=\"Integer\"><UserID Type=\"Integer\" /></Value></Contains></Where>";
        view.Update();
    }
}

Replace "yourwebsiteurlhere" with the website url, "titleoflist" with the title of your list in question, "filteredviewname" with the name of the view, and "assignfield" with the internal name that you used for your assignment field. If you created it through the standard SharePoint UI, this should be the name of the field without any spaces.

As far as where to run the code, you could put this kind of thing in a one-time workflow. I sometimes do that just to make sure I have necessary privileges. Hope this helps!

If you're not able to/allowed to use Visual Studio, then your solution will probably have to be to look into a 3rd party solution.

ccomet
Thanks for your response. However, sharepoint tells me that the filter type contains cannot be used with this type of column. I wonder if I would need a third-party component (something like http://www.software112.com/products/sharepoint-people-contains-filter-webpart.html)
csm8118
You're correct. However, instead of a third-party component, if you have access to the object model and can edit the SPView directly, you should be able to use a CAML Query to achieve this. If you need me to construct an example code snippet, let me know and I'll edit my post, @csm8118
ccomet
Please do provide a sample snippet. I think I should have full rights to edit, but I haven't tried before. Would I need to do this in the sharepoint designer or something else?
csm8118
Thanks. I'll see if I can get that to work.
csm8118
A: 

Try this info site, http://www.sharepointalert.info it has a good alert trouble shooting guide.

Clare