为什么使用视图模板,用$$ViewBody引入的视图中文档删不掉呢
为什么使用视图模板($$ViewTemplate for viewname)用域$$ViewBody引入的视图中文档删不掉呢?
我如果直接是在表单中嵌入的视图就可以删除,而相同的代码用于$$ViewTemplate for ……的表单中(视图用$$ViewBody域引入)就提示
Whoops!
Error 4091:Invalid universal id
Whoops!
Error 91:Object variable not set []
呢?
我使用的代理是在webquerysave中,代理如下:
Sub Initialize
'删除文档的代理
On Error Goto ErrorHandler
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)
Print unid
Call docToDelete.Remove(True)
End Forall
'now redirect the browser to the previous url
Print"[" & doc.HTTP_REFERER(0) & "]"
Exit Sub
ErrorHandler:
Print "<h1>Whoops!<h1>"
Print "Error" & Str(Err) & ":" &Error$
Resume Next
End Sub