sharepoint - checkin 和 checkout SPFile 对象

标签 sharepoint sharepoint-2007

我使用以下代码 checkout 然后 checkin 文件。我使用 IronPython。(说 spfile 是 SPFile 对象)

spfile.CheckOut()
spfile.CheckIn("Done by the script")
spfile.Update()
spfile.CheckOut()
spfile.CheckIn("Done by the script-Second time")

第一次 checkin 该文件。但是第二次,它抛出一个异常,指出该文件已在特定时间被 SHAREPOINT\system 修改。我发现这很模糊,因为我已经更新了文件。任何帮助,将不胜感激

最佳答案

基本上这是一个跨国问题。您需要获取对 SPfile 对象的新引用,以刷新底层版本信息和最后一个事务。

spfile.CheckOut()
spfile.CheckIn("Done by the script")
spfile.Update()

spfile = SPlistItem.File;

spfile.CheckOut()
spfile.CheckIn("Done by the script-Second time")

关于sharepoint - checkin 和 checkout SPFile 对象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1460222/

相关文章:

sharepoint - 最有用的免费 MOSS 2007 实用程序/库?

sharepoint - 隐藏已弃用的共享点网站

sharepoint - 为什么 SPList 的 LastItemModifiedDate 与列表中显示的修改日期不同?

Android 通过验证用户名和密码使用重定向 URL 在 Web View 中查看 .pdf 文件

visual-studio - Visual Studio为每个列表创建1个功能

Sharepoint 多值列?

sharepoint - 用于列出所有 sharepoint 2010/2007 页面及其布局的 Powershell 脚本

visual-studio-2010 - 团队系统 - 为现有团队项目创建 Sharepoint 项目门户

c# - 在 Webpart 中更改命名空间时出错

sharepoint - 防止 SharePoint 列表项删除