本文介绍了使用caml查询更新多个项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用caml查询将表中已修改列的所有行从共享点页面更新为外部列表.

I need to update all the rows of a modified column in a table from share point page to external list using caml query. 

请咨询.

推荐答案

您可以尝试下面的脚本.

<script  type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>

<script type="text/javascript">

function GetItemstoUpdate(){

var soapEnv = "<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'> \
 <soap:Body> \
 <GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'> \
 <listName>Project List</listName> \
<query><Query><Where><Gt><FieldRef Name='ProjectCost'/><Value Type='Number'>1000</Value></Gt></Where></Query></query> \
 <viewFields> \
 <ViewFields> \
 <FieldRef Name='Title' /> \
 <FieldRef Name='Project_x0020_Id' /> \
 <FieldRef Name='ID' /> \
 </ViewFields> \
 </viewFields> \
 <rowLimit>99999</rowLimit> \
 <queryOptions xmlns:SOAPSDK9='http://schemas.microsoft.com/sharepoint/soap/' ><QueryOptions/> \
 </queryOptions> \
 </GetListItems> \
 </soap:Body> \
 </soap:Envelope>";
jQuery.ajax({
 url: "/_vti_bin/lists.asmx",
type: "POST",
dataType: "xml",
data: soapEnv,
 complete: CreateBatchWithListItems,
 contentType: "text/xml; charset=\"utf-8\""
 });
}
function CreateBatchWithListItems(xData, status) {

var oldbatch ="";
jQuery(xData.responseXML).find("z\\:row").each(function () {
oldbatch = AddTobatch(oldbatch,


这里是链接以供参考.

最好的问候,

Lee


这篇关于使用caml查询更新多个项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-22 04:47