使用querymodechange禁用编辑并按表单字段状态排序

问题描述 投票:0回答:1

我创建了一个全局变量名参数。我创建此参数以禁用编辑模式。我有一个状态字段,区别为“活动”,“非活动”和“草稿”。

Sub Querymodechange(Source As Notesuidocument, Continue As Variant)
    Dim session As New NotesSession     
    Dim db As NotesDatabase
    Dim doc  As NotesDocument
    Dim view As NotesView
    Continue = False

    Set db = session.CurrentDatabase
    Set view = db.GetView("(Parameter)")    

    Set doc = view.GetDocumentByKey("UnderInspection", True)
    If doc Is Nothing Then
        Msgbox "Parameter not found"
        Exit Sub
    End If

    If doc.PValue(0)="1" Then
        Msgbox "Under Inspection! "
        Exit Sub
    End If
    Continue = True
End Sub

作为上面的代码,我将使用Querymodechange为表单设置参数。如果它是真的,它将继续为假,否则它将继续为真。

我的问题是,如何为状态字段名称“Active”和“Inactive”设置querymodechange?例如,当文档的状态为“活动”或“非活动”时,它将使用此querymodechange,因为它将禁用编辑模式。但对于“草稿”状态,您可以进行编辑。任何帮助将不胜感激。谢谢!

lotus-notes lotus-domino lotus
1个回答
1
投票
If source.Document.GetItemValue("Status")(0)<>"Draft" Then
     ...
     Exit Sub
End If
© www.soinside.com 2019 - 2024. All rights reserved.