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='New'>";
strBatch+="<Field
Name='ID'>New</Field>";
strBatch+="<Field
Name='Title'>Sample Batch Testing1</Field>";
strBatch+="<Field
Name='Country'>1</Field>";
strBatch+="<Field
Name='Gender'>Male</Field>";
strBatch+="</Method>";
strBatch+="<Method
ID='2' Cmd='New'>";
strBatch+="<Field
Name='ID'>New</Field>";
strBatch+="<Field
Name='Title'>Sample Batch Testing2</Field>";
strBatch+="<Field
Name='Country'>2</Field>";
strBatch+="<Field
Name='Gender'>Female</Field>";
strBatch+="</Method>";
strBatch+="<Method
ID='3' Cmd='New'>";
strBatch+="<Field
Name='ID'>New</Field>";
strBatch+="<Field
Name='Title'>Sample Batch Testing3</Field>";
strBatch+="<Field
Name='Country'>3</Field>";
strBatch+="<Field
Name='Gender'>Male</Field>";
strBatch+="</Method>";
strBatch+="</Batch>";
var res=objList.updateListItems("JWS
Practice",strBatch);
if(res.status==200)
{
alert('Record
Saved Successfully');
}
No comments:
Post a Comment