关于在视图中删除所选文档的不稳定性,大家是否遇到过?
视图中的一列:
"[<span><input type='checkbox' name='Delete' value=" +@Text(@DocumentUniqueID) + "></span>]"
表单中有Delete多值域,隐藏
触发的代理代码:
Sub Initialize
On Error Resume Next
Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim item As NotesItem
Dim docToDelete As NotesDocument
Set db = session.CurrentDatabase
Set doc = session.DocumentContext
Set item=doc.GetFirstItem("Delete")
Forall unid In item.Values
Set docToDelete = db.GetDocumentByUNID(unid)
Call docToDelete.remove(True)
End Forall
Print "<font size=2>所选文档已经删除!点击此处<a href='javascript:history.back();'>返回</a></font>"
Print "<hr size=1 color=#ECECFB>"
End Sub
但是执行的结果是有时候顺利删除,有时候删除不了,执行不稳定,不知道是什么原因,请大侠们指教。