Programmatically create Alert to list
SPAlert oListAlert = ouser.Alerts.Add();
oListAlert.AlertType = SPAlertType.List;
oListAlert.List = olist;
oListAlert.EventType = SPEventType.All;
oListAlert.AlertFrequency = SPAlertFrequency.Immediate;
oListAlert.Title ="My Alert";
oListAlert.Update(false);
i want to set alert for changes to applied those option is there like
ReplyDelete1. Some one change item
I want to set these one of the option on alert
use the following code
ReplyDeleteoListAlert.EventType = SPEventType.Modify;
use this code for an individual item:
ReplyDeleteSPListItem oitems = oweb.Lists["List Title"].Items.GetItemById(1);
SPAlert newAlert = user.Alerts.Add();
newAlert.AlertType = SPAlertType.Item;
newAlert.Item = oitems;
newAlert.EventType = SPEventType.Add;
newAlert.Update();