Prasad Bolla's SharePoint Blog

Click Here to go through the Interesting posts within my Blog.

Click Here to go through the new posts in my blog.

Thursday, January 31, 2013

Deleting More Than One Record using Batch in JQuery And SharePoint Default WebServices

Please go to this post to understand what  JS files you need to download to achieve the required functionality.
 
var strSiteUrl = "http://SPSERVER:100";
var objList = new SPAPI_Lists(strSiteUrl);

var strBatch="";
    strBatch+="<Batch PreCalc='TRUE' OnError='Continue'>";
    strBatch+="<Method ID='1' Cmd='Delete'>";
    strBatch+="<Field Name='ID'>1</Field>";
    strBatch+="</Method>";
    strBatch+="<Method ID='2' Cmd='Delete'>";
    strBatch+="<Field Name='ID'>2</Field>";
    strBatch+="</Method>";
    strBatch+="<Method ID='3' Cmd='Delete'>";
    strBatch+="<Field Name='ID'>3</Field>";
    strBatch+="</Method>";
    strBatch+="</Batch>";
   
     var res=objList.updateListItems("JWS Practice",strBatch);
     if(res.status==200)
     {
        alert('Records Deleted Successfully');
     }
 

No comments:

Post a Comment