HCL Domino 11 - Javascript - 如何在提交文档后重定向到同一文档? - 查看不刷新

HCL Domino 11 - Javascript - How to redirect to same document after doc submit ? - View not getting refreshed

我有一个网络应用程序。使用 documents.form[0].submit() 提交表单后,文档关闭。我不需要关闭,而是需要在编辑模式下打开同一个文档。我试图通过 WebQuerySave 代理打印文档 URL。下面是我在代理中的代码,但由于视图未刷新,因此打印了最后一个文档而不是最后一个文档。我尝试添加 view.refresh 但它仍然得到最后一个文档。如何刷新视图并获取当前保存的文档 URL 或者是否有任何其他方法获取当前保存的文档 URL ?

Sub Initialize
  Dim session As New NotesSession
  Dim db As NotesDatabase
  Dim doc As NotesDocument
  Dim dbview As NotesView
  Dim docUnid As string
  Set db = session.CurrentDatabase
  Set dbview = db.Getview("(WorkOrders)")
  Call dbview.Refresh()
  Set doc = dbview.Getlastdocument()
  docUnid = doc.Universalid
  Print "[https://kclisd01/nibsport.nsf/(WorkOrders)/" & docUnid & "?editDocument]"
End Sub

使用NotesSession.DocumentContext获取代理当前正在处理的文档。

Set doc = session.DocumentContext

如链接的帮助文档中所述:

For an agent run from a browser with @Command([RunAgent]) or @Command[ToolsRunMacro], the in-memory document is the current document. In the case of WebQueryOpen, this is the document before Domino® converts it to HTML and sends it to the browser; in the case of WebQuerySave, this is the document before Domino® saves it.