【发布时间】:2019-09-04 23:47:40
【问题描述】:
- 我想通过代码删除文档库项。
- 假设 Doc 库有一列 FolderId。
- 我想删除 FolderId 为 33 的所有项目。
我正在尝试通过代码将其删除,但仅删除了 FolderId 33 的第一次出现。
当我尝试删除第二个匹配项时,出现以下异常:
“Microsoft.SharePoint.SPException:项目不存在。它可能已被其他用户删除。在 Microsoft.SharePoint.SPListItem.EnsureItemIsValid() 在 Microsoft.SharePoint.SPListItem.PrepareItemForUpdate(Guid newGuidOnAdd, SPWeb web, Boolean bMigration, Boolean& bAdd, Boolean& bPublish, Object& objAttachmentNames, Object& objAttachmentContents, Int32& parentFolderId) at Microsoft.SharePoint.SPListItem.UpdateInternal(Boolean bSystem, Boolean bPreserveItemVersion, Guid newGuidOnAdd, 布尔 bMigration, Boolean bPublish, Boolean bNoVersion, Boolean bCheckOut, Boolean bCheckin ASP._0443e3f9_0806_46ea_98ce_21e2d9f6c224_1904097461.btnDelete_Click(Object sender, EventArgs e) 处 Microsoft.SharePoint.SPListItem.Update() 处的布尔型 suppressAfterEvents)" 请帮助我如何根据folderId从文档库中删除所有项目
【问题讨论】:
标签: sharepoint-2007