Quantcast
Viewing all articles
Browse latest Browse all 6517

New Post: Update One particular item in sharepoint list

Hi,

I am using SPServices for the first time and able to know some details. Here I am trying to add some item to a list which I could do successfully. But I am not able to update a previously added row. Please help.

function UpdateTheList(){
var title_details='XSen';
var name_details='Soumya';

//THIS TO ADD
var fieldsToUpdate = "<Batch OnError='Continue' PreCalc='TRUE'><Method ID='1' Cmd='New'><Field Name='Title'>" + title_details + "</Field>" +"<Field Name='Name'>" + name_details + "</Field></Method></Batch>";

//IS THIS TO UPDATE ?? HOW CAN I SET FILTER / CRITERIA HERE...
var fieldsToUpdate1= "<Batch OnError='Continue' PreCalc='TRUE'><Method ID='1' Cmd='Update'><Field Name='Title'>" + title_details + "</Field>" + "<Field Name='Name'>" + name_details + "</Field></Method></Batch>";


$().SPServices({ 
operation: "UpdateListItems", 
async: false, 
listName: "List1", 
listProperties:"", 
updates: fieldsToUpdate1, 
newFields: "", 
deleteFields: "", 
listVersion: "", 
completefunc: function (xData, Status){alert('Done');}});}


Viewing all articles
Browse latest Browse all 6517

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>