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

推荐订阅源

D
Docker
爱范儿
爱范儿
T
The Exploit Database - CXSecurity.com
量子位
T
Tailwind CSS Blog
T
Threatpost
The GitHub Blog
The GitHub Blog
AWS News Blog
AWS News Blog
云风的 BLOG
云风的 BLOG
K
Kaspersky official blog
P
Proofpoint News Feed
博客园 - 司徒正美
L
LangChain Blog
T
Threat Research - Cisco Blogs
C
CERT Recently Published Vulnerability Notes
罗磊的独立博客
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 叶小钗
S
Secure Thoughts
The Last Watchdog
The Last Watchdog
Spread Privacy
Spread Privacy
H
Hacker News: Front Page
T
Troy Hunt's Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Google DeepMind News
Google DeepMind News
W
WeLiveSecurity
A
Arctic Wolf
Apple Machine Learning Research
Apple Machine Learning Research
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
P
Proofpoint News Feed
T
Tor Project blog
T
The Blog of Author Tim Ferriss
I
Intezer
P
Privacy & Cybersecurity Law Blog
美团技术团队
N
Netflix TechBlog - Medium
博客园_首页
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
Vulnerabilities – Threatpost
Application and Cybersecurity Blog
Application and Cybersecurity Blog
G
Google Developers Blog
Attack and Defense Labs
Attack and Defense Labs
T
Tenable Blog
月光博客
月光博客
Stack Overflow Blog
Stack Overflow Blog
J
Java Code Geeks
腾讯CDC
Microsoft Security Blog
Microsoft Security Blog
A
About on SuperTechFans
Last Week in AI
Last Week in AI

博客园 - 左右间

幻方阵 整数划分问题之寻找 一组不大于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