Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I'm using the GetListItemChangesSinceToken service in order to be notified for changes in a sharepoint list.

This works ok for deleted items since the ChangeType return Delete , but for added items, apparently there is no ChangeType for that action.

http://msdn.microsoft.com/en-us/library/cc264031(v=office.14).aspx

Does anybody knows if there is a way to know if content was added to a list or folder using a SharePoint service?

Thanks in advance

share|improve this question
add comment

1 Answer

I presume your talking about alerts, setting an alert on a list will notify the selected user by email if you add or edit or delete or all of them ;)

by the sharepoint UI:

http://www.hosting.com/support/sharepoint-2010/create-an-alert-for-a-list-or-library

someone has done it for you already by code:

using (SPSite mySiteCollection = new SPSite("http://myserver/myspsite"))
{     
    using (SPWeb mySite = mySiteCollection.OpenWeb(mySiteCollection.RootWeb.ID))
    {

       string myUserLogin = @"MyDomain\MyUser";
       SPUser myUser = mySite.Users[myUserLogin];
       SPAlert newAlert = myUser.Alerts.Add();
       newAlert.Title = "My Title";

       SPListItem myListItem = mySite.Lists["My List Name"].Items.GetItemById(1);
       newAlert.AlertType = SPAlertType.Item;
       newAlert.Item = myListItem;

       newAlert.AlertTemplate = myListItem.ParentList.AlertTemplate;

       newAlert.EventType = SPEventType.Add;

       newAlert.Filter = string.Empty;

       newAlert.AlertFrequency = SPAlertFrequency.Immediate;

       newAlert.Update(true);

    }
}

each step is outlined in detail here:

http://sharepointlive.blogspot.co.uk/2008/10/how-to-create-sharepoint-alerts-for.html

hope it helps :)

share|improve this answer
    
Hey, thanks for the answer, but I was not talking about alerts. On the other hand, maybe this can solve my problem, since apparently there is no way to know if new items was added to a list or folders using the GetListItemChangesSinceToken service. I will give it a try and provide feedback if there is no way to do it using the specified service. –  Omer Jan 18 '13 at 17:47
add comment

Your Answer

 
discard

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.