These two form scripts work together to get and set the environment
variable ENVLoc. When a user composes a new document with the form,
the value of ENVLoc gets placed into the Location field. When a user
saves a document with the form, the contents of the Location field
get saved to the environment variable ENVLoc. This means the user
can compose several new documents without having to fill in the Location
field each time.Sub Postopen(Source As Notesuidocument)
Dim session As New NotesSession
If source.IsNewDoc Then
Call source.FieldSetText( "Location", _
session.GetEnvironmentString( "ENVLoc" ) )
End If
End Sub
Sub Querysave(Source As Notesuidocument, _
Continue As Variant)
Dim session As New NotesSession
Call session.SetEnvironmentVar("ENVLoc", _
source.FieldGetText("Location"))
End Sub