2

我在一个文件夹中有一个文档,AUNID其中的一个字段填充了特定子文档的唯一 ID。在文件夹的操作栏上,我有一个按钮,它应该打开与AUNID用户编辑相关的文档。

当按下操作按钮时,它会给用户以下错误:

Invalid UNID; UNID must be a 32-digit hex string.

但是,在按下“确定”后,会打开正确的文档进行编辑。我已经使用了调试器,并且代码完全按照我的预期执行,但是这个错误似乎没有理由弹出。

这是我的代码:

Sub Click(Source As Button)
    On Error Goto handleError
    Dim ws As New NotesUIWorkspace
    Dim s As New NotesSession
    Dim leaddoc As NotesDocument
    Dim action As NotesDocument
    Dim db As NotesDatabase
    Dim view As NotesView
    Dim doc As NotesUIDocument

    Set db = s.CurrentDatabase
    Set leaddoc = db.UnprocessedDocuments.GetFirstDocument
    Set view = db.GetView("(ActionsByLead)")
    If (leaddoc.GetFirstItem("AUNID").Text = "") Then
        Msgbox ("There is nothing to edit!")
        Exit Sub
    End If
    Dim uid As String
    uid = Cstr(leaddoc.GetFirstItem("AUNID").Text)
    Set action = db.GetDocumentByUNID(uid)
    Call ws.SetTargetFrame("")
    Call ws.EditDocument(True, action,,,, False) 'Error occurs on this line according to the debugger. 

    Exit Sub 
handleError:
    Resume Next
End Sub
4

1 回答 1

4

检查您正在打开的子文档的形式。我怀疑在加载该文档期间存在导致错误的某些东西,并且它与父文档上的操作或 AUNID 项无关。

或者尝试新建一个子文档,看看是否出现错误

于 2013-01-23T21:07:04.767 回答