LOTUSSCRIPT/COM/OLE CLASSES


Examples: ClearProperty method
This example illustrates a button in a composite application that would create a new response document. It checks for a PropertyBroker property, and if one is available, for the value of the Subject property, and stores that information in a profile document. Finally, the Subject property is cleared, so that another response cannot be created for it. The postopen event on the response document then checks for the profile document and uses the value to populate the Subject field in the new response document.

Sub Click(Source As Button)
   Dim s As New NotesSession
   Dim db As NotesDatabase
   Set db = s.CurrentDatabase
   Dim ws As New NotesUIWorkspace
   Dim uiv As NotesUIView
   Set uiv = ws.CurrentView
   viewname$ = Strtoken(uiv.ViewName," ",1)
   Dim pDoc As NotesDocument
   Set pDoc = db.GetProfileDocument("tmpProfile")
   pDoc.viewtitle = viewname$
   Call pDoc.Save(True,False)

   Dim pb As NotesPropertyBroker
   Set pb = s.CreatePropertyBroker()
   If Not pb Is Nothing Then
       subject$ = pb.getPropertyValue("Subject")
   Else
       subject$ = ""
   End If

   Dim uidoc As NotesUIDocument
   Set uidoc = ws.ComposeDocument("","","Response")
   Call uidoc.FieldSetText("Subject",subject$)

   Call pb.ClearProperty("Subject")

End Sub