1
Reply

retrieving single date events from SP calendar List using JS

Madhav

Madhav

Sep 1 2016 4:56 AM
270
here am trying to fetch single date events from javascript in sharepoint hosted app but the code am using that returns all events of SP calendar list
 
var ctx = new SP.ClientContext(appWebUrl);//Get the SharePoint Context object based upon the URL var myList = ctx.get_web().get_lists().getByTitle("MyList"); function retrieveBookingDetails() { var Date ="09/01/2016"; var query = new SP.CamlQuery();     query.set_viewXml('<View><Where><eq><FieldRef Name=\'EventDate\'/><Value Type=\'DateTime\'IncludeTimeValue=\'TRUE\' >' + Date + '</Value></eq>" + "</Where></View>'); var items = myList.getItems(query);      ctx.load(items); );     ctx.executeQueryAsync(onQuerySucceeded, onQueryFailed); function onQuerySucceeded() { ---- ------- } function onQueryFailed(sender, args) {         alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace()); } }
 

Answers (1)