Examples: FieldClear method

This script appends the contents of the LatestEvent field, preceded by three dashes, to the History field, before the document is saved. The LatestEvent field is cleared so that another event can be entered into it.

Sub Querysave(Source As Notesuidocument, Continue As Variant)
  Dim lastEvent As String
  lastEvent = source.FieldGetText( "LatestEvent" )
  Call source.FieldAppendText( "History", "---" )
  Call source.FieldAppendText( "History", lastEvent )
  Call source.FieldClear( "LatestEvent" )
End Sub

After the document has been edited and saved three times, the History field might look like this:

---Aerial photographs of deforestation published---Government reacts---Public protests began today