Lotus脚本如果条件没有退出子

时间:2017-10-11 10:05:02

标签: lotus-notes lotus-domino lotusscript

如果用户输入“number< somevalue(days)”警告用户输入一个大于某个值的新值,我尝试只显示一次消息框。我尝试检查我的代码,但我没有发现问题,为什么重复显示消息框超过1次。 [此代码我在现有事件上编码]

Sub Exiting(Source As Field)
    Dim workspace As New NotesUIWorkspace
    Dim session As New NotesSession
    Dim uidoc As NotesUIDocument
    Dim db As NotesDatabase
    Set uidoc = workspace.CurrentDocument
    Set doc = uidoc.Document

    Dim diff As Long

    Set ComDate = doc.getFirstItem("CompletionDate").dateTimeValue
    Set DueDate = doc.GetFirstItem("DueDate").dateTimeValue

    diff = ComDate.TimeDifference(DueDate)  
    Dim days As Integer
    days=diff/86400
    Dim number As Integer
    Dim num As String
    num=uidoc.FieldGetText("DeliveryTiming")
    number= Cint(num)
    If(number<days) Then 
        Messagebox( "Please specify your request DeliveryTiming?" ),16,"Required input"
        Call uidoc.GotoField( "DeliveryTiming" )
        Exit Sub
    End If
End Sub

0 个答案:

没有答案