Showing posts with label adding sharepoint alert using c#. Show all posts
Showing posts with label adding sharepoint alert using c#. Show all posts

Wednesday, May 2, 2012

Creating SharePoint alert programmatically

The class used to create an alert and generate periodic email, sms to the intended user of the sharepoint site, this alert are related to creation, addition, modification, deletion ect on the list or the document libraries.

We can use following codes to set the “eventtypeindex” property of the SPAlert to specify on what action the alert is generated or created:
  • all = 0
  • added = 1
  • modify = 2
  • deleted = 3
  • web discussions = 4
which can be specified as follows :


//newAlert.EventType = SPEventType.Add;

newAlert.Properties["eventtypeindex"] = "1";



So following is the complete code for creating an alert

Featured Posts

Kali Linux Remote Desktop: Access GNOME from Windows Using Native RDP

  Kali Linux + GNOME 50 + GNOME Remote Desktop + Windows Remote Desktop (MSTSC) Getting a full GNOME desktop remotely on Kali Linux can be ...