6

I need to set a list alert for current (logged in) user using JavaScript.

Code:

    var currentcontext = new SP.ClientContext.get_current();
    var currentweb = currentcontext.get_web();
    currentcontext.load(currentweb);
    var currentuser = currentweb.get_currentUser();
    var list = currentweb.get_lists().getByTitle("List Name");

I am getting the current user and list using this code, but I do not know how to set alert for this user on this list

see below snapshot

enter image description here

I want to set alert same like which mention in snapshot using JavaScript. Is there any way to do it?

2
  • which kinds of alert you want to set? alert user when item changed?
    – Raymond
    Apr 25, 2013 at 10:08
  • i modified my question. Apr 25, 2013 at 10:27

2 Answers 2

4

I did something like this for a client. My solution was made a web service. By this web service I was able to make an AJAX call and create an Alert code behind.

3

There is no built in way via the SharePoint JavaScript Object Model according to my research.

Likely you will have to build your JavaScript to work with the SharePoint 2010 Alerts Web Service: http://msdn.microsoft.com/en-us/library/websvcalerts(v=office.14).aspx using JQuery or whatever framework calls from JavaScript on your page.

1
  • 2
    The SharePoint client side APIs do not support a Create or AddEvent operation, so this is a no go.
    – Paul T.
    May 11, 2014 at 14:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.