根据某些列值以编程方式删除多个共享点列表项
- 我想通过代码删除文档库项目。
- 假设Doc库有一列FolderId。
- 我想删除FolderId 33 的所有项目。
我尝试通过代码删除它,但只有第一次出现的FolderId 33 被删除。
当我尝试删除第二个匹配项时,出现以下异常:
“Microsoft.SharePoint.SPException:项目不存在。它可能已被其他用户删除。位于 Microsoft.SharePoint.SPListItem.EnsureItemIsValid() 位于 Microsoft.SharePoint.SPListItem.PrepareItemForUpdate(Guid newGuidOnAdd, SPWeb web, Boolean bMigration、Boolean& bPublish、Object& objAttachmentContents、Int32&parentFolderId) at Microsoft.SharePoint.SPListItem.UpdateInternal(Boolean bSystem、Boolean bPreserveItemVersion、Guid newGuidOnAdd、Boolean bMigration、Boolean bNo版本,布尔值bCheckOut、布尔值 bCheckin、布尔值抑制AfterEvents) 位于 Microsoft.SharePoint.SPListItem.Update() 位于 ASP._0443e3f9_0806_46ea_98ce_21e2d9f6c224_1904097461.btnDelete_Click(Object sender, EventArgs e) " 请帮助我如何根据folderId删除文档库中的所有项目
- I want to delete Document Library items through code.
- Suppose Doc library has one column FolderId.
- I want to delete all items with FolderId 33.
I am trying to delete it through code, but only the first occurence with FolderId 33 is deleted.
When I to try to delete the second occurrence, the following exception occurs:
"Microsoft.SharePoint.SPException: Item does not exist. It may have been deleted by another user. at Microsoft.SharePoint.SPListItem.EnsureItemIsValid() at 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, Boolean bMigration, Boolean bPublish, Boolean bNoVersion, Boolean bCheckOut, Boolean bCheckin, Boolean suppressAfterEvents) at Microsoft.SharePoint.SPListItem.Update() at ASP._0443e3f9_0806_46ea_98ce_21e2d9f6c224_1904097461.btnDelete_Click(Object sender, EventArgs e) "
Please help me How to delet all items from document library according to folderId
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试向后浏览集合:
Try going backwards through the collection: