I have a form that users specify three names in three separate fields - a sales rep, inside sales rep, and project manager. When the user submits the form I want to give them a prompt that displays these three names and lets them select only one (no editing allowed). When they click the button the code should take the selected name and store that value in a hidden field on the form.
I thought about using a form event, but I’d prefer this be a one-time thing that occurs only once in the life of the document (when it’s first submitted) - which is why I put the code in a button on a subform that only appears when the doc is first submitted.
I’d like to call this from my LotusScript code. I’m interested in any suggestions as to what I may be able to do along these lines, or if it’s a wild goose chase.
Many thanks.
Subject: LotusScript - create choice list from UI fields?
I would prefer to use it on a form event (such as querysave) that does something like thisthis:
If doc.status(0)=“New” then
dim values(3) as Variant
values(0)=“Name1”
values(1)=“Name2”
values(2)=“Name3”
dim response as variant
dim answered as variant
answered=false
While not answered
response = ws.Prompt (PROMPT_OKCANCELLIST, _
“Select a Name”, _
“Select a name.”, _
values(0), values)
If Isempty (response) Then
Messagebox "You must select a
name", , "Name not selected"
Else
answered=true
End If
wend
End Sub
Subject: RE: LotusScript - create choice list from UI fields?
After adapting it to my code it worked perfectly. I usually agree it’d be better to put in a form event, but in this case it works better inserted into a piece of code that will only run once.
Thank you for your help.
Subject: RE: LotusScript - create choice list from UI fields?
the code I gave would run once (on a new submission however you test for that) and takes out the overhead of a computed subform.