惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Secure Thoughts
罗磊的独立博客
T
The Blog of Author Tim Ferriss
人人都是产品经理
人人都是产品经理
博客园 - 叶小钗
Last Week in AI
Last Week in AI
美团技术团队
Google Online Security Blog
Google Online Security Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
D
Docker
G
Google Developers Blog
大猫的无限游戏
大猫的无限游戏
酷 壳 – CoolShell
酷 壳 – CoolShell
小众软件
小众软件
月光博客
月光博客
L
LINUX DO - 最新话题
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
W
WeLiveSecurity
H
Heimdal Security Blog
Vercel News
Vercel News
SecWiki News
SecWiki News
Forbes - Security
Forbes - Security
Blog — PlanetScale
Blog — PlanetScale
Google DeepMind News
Google DeepMind News
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
www.infosecurity-magazine.com
www.infosecurity-magazine.com
TaoSecurity Blog
TaoSecurity Blog
T
Troy Hunt's Blog
A
About on SuperTechFans
C
Check Point Blog
S
Security Affairs
Hacker News - Newest:
Hacker News - Newest: "LLM"
AI
AI
WordPress大学
WordPress大学
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Help Net Security
Help Net Security
博客园_首页
The Last Watchdog
The Last Watchdog
S
SegmentFault 最新的问题
Hugging Face - Blog
Hugging Face - Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
Engineering at Meta
Engineering at Meta
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
I
Intezer
K
Kaspersky official blog
M
MIT News - Artificial intelligence
J
Java Code Geeks
G
GRAHAM CLULEY
P
Palo Alto Networks Blog

博客园 - 左右间

幻方阵 整数划分问题之寻找 一组不大于M的互异的整数集,使之和等于N。找出可能的整数集的个数。 关于在cmd命令里的路径包含空格的问题 MSE-项目管理知识体系(一) 导论 导入导出EXCEL数据时有关时间的处理 比较简单的导入导出EXCEL数据的方法 使用aspnet_regiis.exe加密web.config文件 Stsadm 详细文档 关于SPList的Update及AllowUnsafeUpdates 关于silverlight文件的结构 关于VS.NET权限不够的问题 关于Web Part中的Tokens. 关于AD搜索的The server is not operational错误 IIS 中 Service Unavailable问题的解决方法 Flex样式控制小记 如何在WebPart的菜单中添加自定义的Verbs. 关于FireFox网址收藏夹的比较酷的应用 SharePoint中传递Search参数的Url的一些研究 关于使用JavaScript触发ASP.NET Validator验证的问题
如何使用CAML 批量更新SharePoint List
左右间 · 2008-07-30 · via 博客园 - 左右间

使用SharePoint就像小时候玩藏宝游戏,不停的去找,总能找到新东西。

以前使用CAML很多次,虽然知道他很强大,但只是局限于查询。今天读了一篇文章,才知道他还可以用来批量更新。不多说,直接上XML sample.

<?xml version="1.0" encoding="UTF-8"?>
  <ows:Batch OnError="Return">
 <Method ID="{0}">
 <SetList>{1}</SetList>
 <SetVar Name="Cmd">Save</SetVar>
 <SetVar Name="ID">{2}</SetVar>
 <SetVar Name="urn:schemas-microsoft-com:office:office#Processed">{3}</SetVar>
 <SetVar Name="urn:schemas-microsoft-com:office:office#Processed_Date">{4}</SetVar>
        </Method>
  </ows:Batch>

据SDK记载,Batch标签有如下描述。
<Batch
  OnError = "Return" | "Continue"
  ListVersion = ""
  Version = ""
  ViewName = "">
  <Method>
  ...
  </Method>
  ...
</Batch>

Return :在第一次出错后不再执行后续的Methiod.
Continue :在出错后继续执行后续的Methiod.
ListVersion :List的版本号。(可选)
Version :SharePoint的版本号。(可选)

在sample中,{1}为List ID.{2}为Item ID.{3}和{4}为要更新的属性值。其中属性的名称为<schema>#<internal_field_name>.
比如,你的List名字为Processed,那么,这里的名称为urn:schemas-microsoft-com:office:office + # + Processed。

<Method ID="Text"  Cmd = "Text">
</Method>

Cmd

Delete — Delete the specified item.

New — Create the specified item.

Update — Modify the specified item.

参考文章:http://msdn.microsoft.com/en-us/library/cc404818.aspx