SNTT : Validating a Notes Client Rich text field

Rather than testing the field on the Notes Document object (my reflex habit) , test a rich text field in the Notes UI Document object, because until the document has been saved, the rich text field either does not yet exit (if a new document) or hasn’t been updated.

The assumption in the code below is that Source is a NotesUiDocument object, the “title” field is a editable text field and “body” is a editable rich text field, and the whole thing is part of the forms query save event.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Sub Querysave(Source As Notesuidocument, Continue As Variant)

  If Source.Document.Title(0) = "" Then
     Msgbox "Please add the Title value.", 0 + 16, "Validation Error"
     Source.GotoField("Title")
     Continue = False
     Exit sub
  End If

  If Source.FieldGetText( "body" ) = "" Then
     Msgbox "Please add the the Body value.", 0 + 16, "Validation Error"
     Call Source.GotoField( "body" )
     Continue = False
     Exit sub
  End If

end sub
This entry was posted in Code, Lotus Domino, Show-n-Tell+Thursday. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*
  • Follow

  • Archives (since 2003)

  • Categories

  • Recent Posts

  • Twitter Updates

    • I liked a YouTube video -- Recycle your unwanted electronics - City of Toronto http://youtu.be/91OXkMkesBc?a 13 hours ago
    • I'm organizing and coordinating my Japan Trip with Google Wave. Seeing both the promise and the fail. of the product. 18 hours ago
    • I have failed my saving Throw against Shiny ... I new 32G iPod Touch is on order :) 1 day ago
  • del.icio.us links

  • Flickr

    Hanging Gardens of KensingtonHanging Gardens of KensingtonMore Chocolate CakeMore Chocolate Cake
  •  

    May 2009
    M T W T F S S
    « Apr   Jun »
     123
    45678910
    11121314151617
    18192021222324
    25262728293031
  • Spam Blocked