Skip to content

Instantly share code, notes, and snippets.

@javierguerrero
Last active August 29, 2015 14:07
Show Gist options
  • Save javierguerrero/3860f1cadbde5195b93d to your computer and use it in GitHub Desktop.
Save javierguerrero/3860f1cadbde5195b93d to your computer and use it in GitHub Desktop.
CSOMJavaScriptUpdate.js
function updateListItem(listName, id,title) {
var ctx = new SP.ClientContext();
var oList = ctx.get_web().get_lists().getByTitle(listName);
var olistItem = oList.getItemById(id);
olistItem.set_item("Title", title);
olistItem.update();
ctx.load(olistItem);
ctx.executeQueryAsync(
function () {
console.log('updated success');
},
function (sender, args) {
console.log('Error in updating data');
}
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment