Last active
August 29, 2015 14:07
-
-
Save javierguerrero/3860f1cadbde5195b93d to your computer and use it in GitHub Desktop.
CSOMJavaScriptUpdate.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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