When I omit the notesdocument parameter in Dialogbox method, the Field update function is working properly. But when I use the notesdocument parameter in it, the Field update function is not available. I have tried this on ND5.0.10, but the same problem was also existed. Have you encountered this? or please feel free to try as followings:Definition:
I had a similar problem when I was looping through a document collection. I’d ws.dialogbox every document, and the changes I made wouldn’t take. Saving the document after calling the dialogbox method fixed it. seems rather obvious now.
My problem is when I have a field which named “Fieldone” in the main form, and also have the same field in the subform. And then when I use the dialogbox method without Notesdocument parameter, the edits are passed to the underlying document. but when I use the dialogbox method with Notesdocument parameter, then no any edits being passed. I believe thats really a bug, I have tested in ND5.0.10 and ND6.5.1.
It sounds like you’re expecting DialogBox to automatically copy field values from a document you pass it, to another document that’s open on screen.
What you’re seeing here is Notes working as designed. If you specify a document, you have total control over what happens to the field values the user enters in that document. If you want them to have values when the dialog opens, you have to set them. If you want to use the values the user entered, you have to get them from the document and do something with them.
Dim ws As NotesUIWorkspace Dim se As NotesSession
Dim dbCurr As NotesDatabase
Dim docCurr As NotesDocument, docDialog As NotesDocument
Set dbCurr = se.CurrentDatabase
Set docCurr = ws.CurrentDocument.Document
Set docDialog = New NotesDocument(dbCurr)
' copy data from the current document (or from elsewhere)
Call docDialog.ReplaceItemValue("Field1", docCurr.GetItemValue("Field1"))
If ws.Dialogbox("Yourform", True, True, False, False, False, False, "Testing", docDialog) Then
' user pressed OK -- copy values back.
Call docCurr.ReplaceItemValue("Field1", docDialog.GetItemValue("Field1"))
' or
docCurr.Field2 = docDialog.Field2
End If
though if this is all you’re going to do, you might as well not create a new NotesDocument, and just not supply the NotesDocument argument.
Ok a simple form with one field called from an action
Sub Click(Source As Button)
Dim ws As New NotesUIWorkspace
Dim ss As New NotesSession
Dim doc As notesdocument
Dim db As notesdatabase
Set db=ss.CurrentDatabase
Set doc=New notesdocument(db)
Call ws.Dialogbox("dia", True, True, False, False, False, False, "Testing", doc)
Msgbox doc.Fieldone(0)
End Sub
The msgbox shows me exactly what I typed in the dialogue box. R5.0.10 / 6.0
How/where are you calling dialogbox and how are you testing the returned result?