Popup on Field Selection in Lotus Notes


I would like to have a Yes|No popup window when some selects a certain item in a dialog list field. For instance, if the user selects "Scanner Setup", I would like to have a popup with Yes|No where yes opens a Notes form. Originally I had a button, but I want to make sure the user selects after they request "Scanner Setup."

Thanks in advance.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Sjef BosmanGroupware ConsultantCommented:
You could try to set the field to "Refresh form when field value changes", and use the PostRecalc event of the form to compare the current value to "Scanner Setup", in which case you can start your new form.
ajl7519Author Commented:
Thanks for the reply.

Well, I have the field to refresh to display a new dialog field list dependent on the choice. I am bit new to Lotus Scripting. The form I am trying to open is an existing form. I was trying to have an Exiting function, but I can't seem to get it down. Here is the beginning part I have got so far.


Sub Exiting(Source As Field)
	Dim workspace As New NotesUIWorkspace
	Dim uidoc As NotesUIDocument
	Set uidoc = workspace.CurrentDocument
	Dim openDoc As Integer
	If (uidoc.fieldgettext("ServiceType") = "Scanner Setup") Then
		openDoc = ws.Prompt (PROMPT_YESNO, _
		"Scanner Setup", "Click Yes to open Scanner Setup Instructions")
		If openScan = 1 Then
Code I would use to open form
Code to cancel
		End If
	End If
End Sub

Open in new window

Sjef BosmanGroupware ConsultantCommented:
First, some definitions: a document contains data, a Form is used to display the contents of a document. So I suppose you're trying to open an existing document (and the form comes with it, right?).

Then, ALWAYS add Option Declare to your code, at the start (or set the "Automatically include Option Declare" option in the Editor Preferences°. That would show you that you use openDoc and openScan in your  code, I assume they're supposed to be one...

But what I fail to see is what you want to accomplish. If each time someone exits your field (which happens when he moves to the next field), he will get your question about the scanner setup instructions, which will probably very annoying after some time. How do you want your application to work? Can you depict, in your head and then here in text, how the user should work with it?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Become a Microsoft Certified Solutions Expert

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

ajl7519Author Commented:
This is a ticketing database that users can fill out their requests in. For instance on the scan setup I want them to get the instructions once they select that request. Ever request ask for different information for the user to input based on what they are requesting. There are a lot of issues that can be solved without my intervention--I would like to be able include fixes when users make certain requests.

Maybe a button is the way to go or even sending a link to the instructions in the email the ticketing mailbox sends out when the ticket is submitted.
Sjef BosmanGroupware ConsultantCommented:
Why open a new form or document when a selection is made? In the PostRecalc, you could do a DbLookup for a document in your database that contains help text. You could put that text in the current form, with the selection field, just as a reminder. That seems doable and not too time-consuming. Do you have open space left in your form, for that informational text?
ajl7519Author Commented:
The form is pretty dense, so I have decided to use a mail template to send out  the instructions out to the user. I think that will be the best way to not confuse the users. Once I complete my part I will send the instructions to the users.

Thanks for your help.
Sjef BosmanGroupware ConsultantCommented:
You're welcome. Maybe it's worthwhile to add a feature to your application that prevents the same mail with instructions to be sent more than once. Or that a button is visible for the user to request the mail or so? Or as a doclink? Remember, mail is much more volatile than a document database...
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.