2
votes

i have a doc with embedded view... in this embedded view i have a button that compile some code. Inside this code i have Set Coll=db.unprocesseddocuments instructioin so when i select document inside this embedded view i think the collecion is composed by the document that i have select. But the collecion contains the current uiwork documents instead the document that i have select inside the embedded view. Why ? How can i populate the collection with the selected document of the embedded view ? With @command([toolsrunmancro];"MyAgent") instead the simply code inside the button the result is the same... Someone can help me ?

2

2 Answers

3
votes

This example works for me:

Action button "Test" in view (LotusScript)

Sub Click(Source As Button)
    Dim session As New NotesSession
    Dim db As NotesDatabase
    Dim col As NotesDocumentCollection
    Dim doc As NotesDocument
    Set db = session.CurrentDatabase
    Set col = db.UnprocessedDocuments
    Set doc = col.GetFirstDocument
    While Not doc Is Nothing
        Print doc.UniversalID
        Set doc = col.GetNextDocument(doc)
    Wend
End Sub

The Embedded View properties are

enter image description here

After selecting documents in embedded view a click on action button "Test" prints all selected documents Universal ids.

enter image description here

1
votes

I think the key to Knut's answer is that the button in question must be an action button within the embedded view, and not a button on the form.