Search code examples
fieldlotus-noteslotusscript

How can i write the code to do "When i click cancel in options windows , that field will hide."


I have a field in the Notes document , the field name is "reason". if i click a button,will show a options windows , and the field will show out. now i need to know how can i write the code to do "when i click cancel in options windows , that field will hide.". the options windows is PROMPT_OKCANCELLIST. the following codes is i write in the button:

If uipr.FieldGetText("TRACK_MARK") = "" Then
    Call uipr.FieldSetText("TRACK_MARK" , "Y")
End If
askme = ws.prompt(PROMPT_OKCANCELLIST,"Track Reason","Please choose reason..." , data(0) , data())
If askme = "" Then
    If uipr.FieldGetText("TRACK_MARK") = "Y" Then
        Call uipr.FieldSetText("TRACK_MARK" ,"")
        Exit Sub
    End If
End If

Solution

  • In the Form with the Reason field, you will need to select the paragraph you wish to hide, then in the Properties box, select Hide paragraph if formula is true, and enter TRACK_MARK="Y" :

    enter image description here

    This will hide the paragraph once TRACK_MARK is set to "Y".