sharepoint - 不能在不增加处理项目版本的情况下使用 ProcessBatchData

标签 sharepoint sharepoint-2007

我需要使用 web.ProcessBatchData 更新 SPListItem 而不创建新版本。

我试过使用这个 xml:

<?xml version="1.0" encoding="UTF-8"?> 
<ows:Batch OnError="Continue"> 
  <Method ID="1"> 
    <SetList>{some-guid}</SetList> 
    <SetVar Name="Cmd">Save</SetVar> 
    <SetVar Name="ID">{list-item-id}</SetVar> 
    <SetVar Name="owshiddenversion">{current-item-version}</SetVar> 
    <SetVar Name="urn:schemas-microsoft-com:office:office#Title">some title</SetVar> 
  </Method> 
</ows:Batch>

在此 xml 上执行 BatchData 后,即使没有更改任何可见项目字段,我也收到了新版本 ({previous-version} + 1)。

是否可以以与 SystemUpdate(false) 相同的方式使用 ProcessBatchData?

附言我需要更新列表项。前面提到的 xml 可以完美地更新 DocumentLibrary 项目......

最佳答案

一块蛋糕 :) 哈哈

 using (var disabler = new DisabledEventFiringScope())
    {
        web.ProcessBatchData(batchXml);
    }

这是 DisabledEventFiringScope 类的代码:
class DisabledEventFiringScope : SPEventReceiverBase, IDisposable
{
    public DisabledEventFiringScope()
    {
        EventFiringEnabled = false;
    }

    public void Dispose()
    {
        EventFiringEnabled = true;
    }
}

关于sharepoint - 不能在不增加处理项目版本的情况下使用 ProcessBatchData,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5181610/

相关文章:

javascript - 使用jquery替换url参数和文本?

sharepoint - 母版页更改未反射(reflect)给 sharepoint online 2013 中的其他登录用户?

asp.net - 如何使用自定义登录页面(不是 Windows 登录框)进行 Windows 身份验证?

sharepoint - 在 SharePoint 中实现社交网络方面的建议

sharepoint - 什么时候在 webpart 中使用查询字符串?

c# - 如何筛选 SharePoint 上的列表

sharepoint - WebPart 安全性

SharePoint 网站设计与实现 : "Online Manual"

sharepoint - Windows Share Point Service 和 MOSS 之间的区别

sharepoint - 带有 SharePoint 的 ADFS 2.0 未被识别为受信任的应用程序并抛出