Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Lotus notes 文档命令不可用错误_Lotus Notes - Fatal编程技术网

Lotus notes 文档命令不可用错误

Lotus notes 文档命令不可用错误,lotus-notes,Lotus Notes,当我尝试执行表单的批准操作时,为什么会出现“Document command not available error”(文档命令不可用错误)。这就像一个审批流程。此错误仅对最后一个审批人发生。单击“由最后一位审批人审批”时,会发生此错误。而且该文件没有得到批准。拒绝时会出现不同的错误消息,如“Notesdocument无法定位字段”,但按“确定”时会拒绝该文档。谁能帮帮我吗。 下面是批准操作的代码 Sub Click(Source As Button) Dim w As New notesuiw

当我尝试执行表单的批准操作时,为什么会出现“Document command not available error”(文档命令不可用错误)。这就像一个审批流程。此错误仅对最后一个审批人发生。单击“由最后一位审批人审批”时,会发生此错误。而且该文件没有得到批准。拒绝时会出现不同的错误消息,如“Notesdocument无法定位字段”,但按“确定”时会拒绝该文档。谁能帮帮我吗。 下面是批准操作的代码

Sub Click(Source As Button)
Dim w As New notesuiworkspace
Dim uidoc As notesuidocument
Set uidoc = w.currentdocument

process =True
approveapplication
gprocess = False

uidoc.Save

uidoc.Refresh
端接头

以及拒绝行动

Sub Click(Source As Button)
Dim w As New notesuiworkspace
Dim uidoc As notesuidocument

Set uidoc = w.currentdocument
process = False
rejectapplication
gprocess = False

uidoc.Save
uidoc.Refresh
端接头

对于以前的审批人来说,上述操作没有问题。
请帮助

此错误通常发生在UI类尝试执行操作而后端安全强制阻止该操作的情况下。如果approveapplication函数中的代码正在对后端NotesDocument对象进行更改,特别是对任何reader或author Name字段的更改,这就可以解释它。如果不是这样的话,我见过第三方产品的extension manager插件模块与Notes客户端集成导致此错误的情况

“Document command not available”(文档命令不可用)错误表示您试图以错误模式访问或执行某些操作。在调用uidoc.save之前,需要检查您是否处于编辑模式。您的批准代码应该如下所示

Sub Click(Source As Button)
    On Error Goto errHandle
    Dim w As New notesuiworkspace
    Dim uidoc As notesuidocument
    Set uidoc = w.currentdocument
    If Not uidoc.EditMode Then
        uidoc.EditMode = True
    End If
    process =True
    approveapplication
    gprocess = False
    uidoc.Save

    Exit Sub
errHandle:
    Messagebox Lsi_info(2) + ": Error " + Str(Err) + " - " + Error(Err) + ", at line " + Str(Erl)
    Exit Sub
End Sub
您不应该在调用save后调用uidoc.refresh,否则即使没有更改,在文档关闭时也很可能会提示用户再次保存文档。有关uidoc.save和uidoc.editmode的信息,请查看notes designer帮助。另外,请注意错误处理,错误处理将帮助您查明此类问题

Sub Click(Source As Button)
    On Error Goto errHandle
    Dim w As New notesuiworkspace
    Dim uidoc As notesuidocument
    Set uidoc = w.currentdocument
    If Not uidoc.EditMode Then
        uidoc.EditMode = True
    End If
    process =True
    approveapplication
    gprocess = False
    uidoc.Save

    Exit Sub
errHandle:
    Messagebox Lsi_info(2) + ": Error " + Str(Err) + " - " + Error(Err) + ", at line " + Str(Erl)
    Exit Sub
End Sub

如果访问表单上不可见的字段,可能会出现“拒绝”操作问题。同样,添加错误处理,故障排除会容易得多。

我处理来自LotusNotes数据库的大量数据,这种情况一直发生在我身上

与其他答案相反,在我的例子中,原因是不同的:似乎正在调用。编辑返回控件太快。。。下一个命令(如SelectAll)无法执行,因为文档未完全打开进行编辑

解决方案。。。是西姆莱。我添加了小睡眠(1000ms),以便文档有足够的时间,并且一切正常