Search code examples
lotus-noteslotus-dominolotus-formula

Opening a document in dialog box from an embedded view opening blank


I have a form in which I have embedded a view. Now from that embedded view I need to open the document in a dialog box. So I created a new form specific for that dialog box and in the QueryOpenDocument added

@DialogBox("mdro";[AutoHorzFit]:[AutoVertFit]:[OkCancelAtBottom]:[SizeToTable];"My Data")

Now, this is opening up a blank dialog box.


Solution

  • You will not be able to solve this using Formula, as the Context of your "Action" most probably will NOT be the selected document from the view.

    QueryOpenDocument is the right place to go, but you have to code this in LotusScript:

    Dim doc as NotesDocument
    Dim ws as New NotesUIWorkspace
    
    Set doc = Source.Documents.GetFirstDocument()
    If not doc is Nothing then
      Call ws.Dialogbox("mdro", True, True, True, False, False, False, "My Data ", doc, True, True, True)
    End If
    
    'Set Continue to false to prohibit opening of the document
    Continue = False
    

    Take care: Somewhere in your code you have to save the document (using doc.Save(True, True, True), otherwise the changes will not be visible....