Friday, November 20, 2015

How to update/insert item in SharePoint list or list form using SPService



function UpdateItem(fieldInternalName,fieldValue)
{
$().SPServices({
operation: "UpdateListItems",
async: false,
batchCmd: "Update",
listName: "Sub Investment",
valuepairs: [[fieldInternalName, fieldValue]],
completefunc: function(xData, Status)
{ alert("Yahoo! Item updated"); }
});
}

batchCmd: "Update" or "New".
listName: display name of list.

No comments:

Post a Comment