Context:I’m using @DialogBox to display a form which receives input from the user. When the user clicks ok (provided the information entered was valid) a new document is created and I then attempt to open the newly created document.
Problem:
This code used to work (prior to the 7.0.1 release as far as I can tell), but now I receive the following error message:
“Notes Error - This operation is not allowed while a dialog box is displayed.”
Is this something that was added to 7.0.1? Anyone else experiencing this?
My work-around has been to stop using @DialogBox and just display the form full screen. But this isn’t really an ideal solution as the user can easily switch to a different document/view/etc. without entering anything into the form. @DialogBox worked well, but I’m open to other suggestions.
Thanks!
Subject: RE: @DialogBox breaking change in 7.0.1?
It would help us to help you, if you provided some details. For instance, what code do you have in the dialog form itself, and in the script that opens the dialog?
If you are trying to open a document from the OK button of the dialog, then it is no surprise that it doesn’t work; it would surprise me that it ever did work. You must open the document from the code that opens the dialog. It seems that you are using macro language to open the dialog. You might consider using LotusScript instead, so that you can create and open your document more easily.
Subject: RE: @DialogBox breaking change in 7.0.1?
The code I was using to launch the DialogBox is as follows:
@DialogBox(“SelectProfileDialog”; [AutoHorzFit] : [AutoVertFit] : [NoNewFields] : [NoFieldUpdate] : [SizeToTable] : [NoCancel] : [NoOkCancel]; “Select profile…”)
The code I added to the OK button is as follows:
Dim session As New NotesSession
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
’ …
Set uidoc = workspace.CurrentDocument
’ perform validation on input…and create a new document that is referenced by the doc variable
Call workspace.EditDocument(True, doc)
uidoc.Close
The dialog that is displayed has 4 or 5 fields on it that need to be filled in by the user. This data is used to populate the fields of a new document which needs to be opened after displaying the dialog.
Hope that helps to explain the situation, but let me know if further details would be useful.
Subject: RE: @DialogBox breaking change in 7.0.1?
Dim wksp As New NotesUIWorkspaceDim session As New NotesSession
Dim db As NotesDatabase
Dim docDialog As NotesDocument
Dim uidocNew as NotesUIDocument
Set db = session.CurrentDatabase
Set docDialog = db.CreateDocument
If wksp.Dialogbox("SelectProfileDialog, true, true, False, true, false, false, “Select profile…”, docDialog, true, false, true) then
Set uidocNew = Call wksp.EditDocument(true, docDialog)
Call uidocNew.FieldSetText(“somefield”, “somevalue”) ’ make the document modified so the user will be prompted if they try to close without saving.
End If
Remove your custom OK button.