Is it possible to use dialog box without a form (e.g., from a view)? And if so, how can I retrieve the values from the dialog box?
Subject: Dialogbox without form
Scott,
The dialogbox still has a form, it’s just that you’re not sitting in a document.
dim tdoc as notesdocument
set tdoc = db.createdocument
tdoc.field1 = x
tdoc.field2 = y
call w.dialogbox ( …, tdoc )
Then you pull the field1 and field2 values out of tdoc and put them wherever you need them.
hth,
raphael
Subject: RE: Dialogbox without form
Thanx! That’s exactly what I needed!
Subject: Dialogbox without form
It is possible…
Please notice a parameter in the dialogbox function:
flag = notesUIWorkspace.DialogBox( form$ , [autoHorzFit] , [autoVertFit] , [noCancel] , [noNewFields] , [noFieldUpdate] , [readOnly] , [title$] , [notesDocument] , [sizeToTable] , [noOkCancel] , [okCancelAtBottom] )
the [notesDocument] parameter…
When calling from a view… this is just a little sample code…
Dim session as new notessession
Dim db as NotesDatabase
Dim collection as NotesDocumentCollection
Dim cdoc as NotesDocument
Dim workspace as New NotesUiWorkspace
Dim tempDoc as NotesDocument
Set db = session.currentDatabase
Set collection = db.unprocesseddocuments
if collection.count = 0 then
Messagebox 'Please select a document to be acted upon",16,“Failure”
Exit sub
end if
Set cdoc = collection.getfirstdocument
Set tempDoc = db.CreateDocument
flag = workspace.DialogBox( “dialogboxform” , true , true , false , false , false, false , “Dialogbox”, tempDoc ,true)
If flag then
Do until cdoc is nothing
cdoc.fieldName = tempDoc.fieldName..
keep setting fields...
call cdoc.save(true,true,true)
set cdoc = collection.getnextdocument(cdoc)
Loop
End if
Subject: RE: Dialogbox without form
Thanx! I never noticed that parameter. I ended up using your code and worked great!