Picklist In Lotusscript
selection.
With this solution you're able to let a user make a selection from a list,
based on a value which is available in the code.
Eventually the selection can be used within the LotusScript code.
First, create a dummyform with a SaveOptions field on it with value "0".
Add a dummyfield in which from the script data is placed. This field is used to
as key for the list to be generated.
Add another dummyfield which will be used to put in the selection from the user.
On the Postrecalc event of this dummyform add a value (like "No Selection")to
the dummyfield.
Then also on the Postrecalc event generate a list from which the user can
select (like @Picklist or @DbColumn) and put the selection on the dummyfield.
If the user cancelles the selection the initial value remains in the field.
Now, in the script you're running compose a document on your front-end with the
dummyform and refresh it. Now the list is prompted to the user and the
selection is placed into the dummyfield.
You can simply retrieve the value from the dummyfield in the script and close
the document based on the dummyform.
script:
Setuidoc = WS.ComposeDocument( "","","frmPickListCountry" )
Call uidoc.FieldSetTex( "dummyCountry", doc.EnvironmentName(0))
Call uidoc.Refresh
Postrecalc:
FIELD Country := "NoSelection";
tmp := @PickList( Custom] ; "" ; "ISO" ; "Please, select the correct Country or
press Cancel" ; DummyCountry ; 1);
@If( tmp = ""; ""; @SetField("Country"; tmp ) )
return to the script:
Dim sCountry As String
sCountry = uidoc.FieldGetText( "Country" )
Call uidoc.close
If sCountry <> "NoSelection" Then
Set destdoc = Destview.GetDocumentByKey( sCountry, True )
end if