Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Load discussion items from Discussions List
function getDiscussions(listTitle,OnItemsLoaded,OnError)
{
var context = new SP.ClientContext.get_current();
var web = context.get_web();
var list = web.get_lists().getByTitle(listTitle);
context.load(list);
var qry = SP.CamlQuery.createAllFoldersQuery();
var discussionItems = list.getItems(qry);
context.load(discussionItems);
context.executeQueryAsync(
function() {
OnItemsLoaded(discussionItems);
},
OnError
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.