• Skipping validation in UI when field is not visible or not editable??

    By Eric H Romo 2 decades ago

    How can this be accomplished within the FieldValidator class? for example within a QuerySave using a NotesUIDocument.

    • Warning: Ugly solution

      By Eric H Romo 2 decades ago

      here's an example using a brute force method to gather the editable fields in the current uidocument:



      Ugly?

      • enters and exits every editable field
      • may trigger field events
      • causes a beep when done



        Function getEditableFieldNames(uidoc As Variant) As Variant

        On Error Goto gef_EH

        Dim tmp As String

        Const FIRST = "Supervisor"

        Dim strCurrent As String

        Dim tmpLst List As Boolean

        'Supervisor

        strCurrent = uidoc.CurrentField

        Call uidoc.GotoTop

        Call uidoc.GotoField(FIRST)

        TMP = uidoc.CurrentField

        While Not Iselement(tmpLst(tmp))
        tmpLst(tmp) = True      <br/>
        Call uidoc.GotoNextField<br/>
        TMP = uidoc.CurrentField<br/>
        
        Wend

        Call uidoc.GotoField(strCurrent)

        getEditableFieldNames = tmpLst

        Stop

        Exit Function



        gef_EH:

        LogError

        Stop

        Exit Function

        End Function