Skip to main content

SharePoint Alerts: The default 9 "Send Alerts for These Changes " Task List Alerts

Hello folks.

Once upon a time, I was trying to create SharePoint Task list Alerts programmatically for each user that had been granted permissions to the specific site. The requirement was that these users would be assigned tasks and they needed to receive notifications summarising all the tasks that they had been assigned, on a daily basis.
Thanks to our old man Mr SharePoint, who has Alerts that can help us achieve this need. The major work for me to achieve this was setting up the "Send Alerts for These Changes" filter, which required building a CAML query. I finally came right but then I thought about documenting the CAML queries for each one of these filters,, with the correct syntax, which by default out-of-the-box are 9, and am sure would save someone sometime.

So here is a list of the default 9 "Send Alerts for These Changes " Task List Alerts.

1. Anything changes
alert.Filter = "";
2. A task is assigned to me
alert.Filter = "<Query><And><Eq><Value type="string">" + user.LoginName + "</Value><FieldRef Name="AssignedTo/New"/></Eq><Neq><Value type="string">" + user.LoginName + "</Value><FieldRef Name="AssignedTo/Old"/></Neq></And></Query>";
3. A task becomes complete
alert.Filter = "<Query><And><Eq><Value type="string">completed</Value><FieldRef Name="Status/New"/></Eq><Neq><Value type="string">completed</Value><FieldRef Name="Status/Old"/></Neq></And></Query>";
4. A high priority task changes
alert.Filter = "<Query><Or><Eq><Value type="string">" + PriotityChoiceString + "</Value><FieldRef Name="Priority/New"/></Eq><Eq><Value type="string">" + PriotityChoiceString + "</Value><FieldRef Name="Priority/Old"/></Eq></Or></Query>";
5. Someone else changes a task assigned to me
alert.Filter = "<Query><And><Or><Eq><Value type="string">" + user.LoginName + "</Value><FieldRef Name="AssignedTo/New"/></Eq><Eq><Value type="string">" + user.LoginName + "</Value><FieldRef Name="AssignedTo/Old"/></Eq></Or><Neq><Value type="string">" + user.LoginName + "</Value><FieldRef Name="Editor/New"/></Neq></And></Query>";
6. Someone else changes a task

alert.Filter = "<Query><Neq><Value type="string">" + user.LoginName + "</Value><FieldRef Name="Editor/New"/></Neq></Query>";
7. Someone else changes a task created by me

alert.Filter = "<Query><And><Or><Eq><Value type="string">" + user.LoginName + "</Value><FieldRef Name="Author/New"/></Eq><Eq><Value type="string">" + user.LoginName + "</Value><FieldRef Name="Author/Old"/></Eq></Or><Neq><Value type="string">" + user.LoginName + "</Value><FieldRef Name="Editor/New"/></Neq></And></Query>";
8. Someone else changes a task last modified by me

alert.Filter = "<Query><And><Eq><Value type="string">" + user.LoginName + "</Value><FieldRef Name="Editor/Old"/></Eq><Neq><Value type="string">" + user.LoginName + "</Value><FieldRef Name="Editor/New"/></Neq></And></Query>";
9. Someone changes an item that appears in the following view
alert.Filter = "<Query><Eq><FieldRef Name="AssignedTo"/><Value type="string">" + user.LoginName + "</Value></Eq></Query>";

Enjoy!

Comments

Popular posts from this blog

Zambia's first Helpdesk System on SharePoint

For my 25th birthday today 3rd March, 2009, allow me to present to you another first of its kind in Zambia. Yes we have done it again, having been Project manager, I present to you Zambia's first Helpdesk System which Masialeti and I have developed on Microsoft Office SharePoint Server 2007. The system also implements SharePoint designer workflows, Infopath forms, SharePoint document library and sends email notifications to the relevant personnel. When a user logs in a call, the user automatically receives a mail from the system, telling them that their call has been received and is being attended to, IT section will also receive a notification and the helpdesk manager will assign the call to the right IT guy who will also automatically receive a mail notification from the system. When the call is resolved, the user again automatically gets notified by the system with a mail giving them description of the problem they logged and also how it has been resolved. The user also has an

How to implement a SharePoint "Change Management Process"

Not so much from the technical point of view, SharePoint Change Management is the process of monitoring and controlling changes within a SharePoint project. By managing the implementation of change, you can: • Reduce the impact of changes to the SharePoint project • Identify new issues and risks as a result of changes raised • Ensure that changes do not affect the SharePoint project's ability to achieve its desired objectives • Control the cost of change within the SharePoint project Change Management is comprised of the following processes: Step 1: Identify Change: The first step in the change process is to identify the need for change. Any team member can suggest a change to the SharePoint project, if he or she believes it is needed to keep the SharePoint project producing deliverables to the customer's specified requirements. After identifying a need for change, the team member records relevant information on a Change Request Form (commonly called a CRF), describing the chan