how to: push button in db1, select doc1 from view in db2, create doc2 with infro from doc1 in db3?
I have done this before (I think), but it has been awhile and my scripts fingers are rusty… can I do this?
Want to push a button in db1, have the script open a notes ui view - pick a doc1, then have the script create a new doc2 in a third db with info from the doc1.
How does the script know I have selected a doc in the view and to move on with the rest of the tasks in the script? Is there a better/diff way to do this? Can I do this with @formulas?
Am I sure this is all very easy if you know how to do it? Help/thoughts/idea appreciated.
My rusty attempt below - some code from help is embedded - ignore.
Sub Click(Source As Button)
Dim session As New NotesSession
Dim dateTime As New NotesDateTime(Cstr(Datenumber(2000, 5, 1)))
Dim thisdb As NotesDatabase
Dim i3DB As NotesDatabase
Dim ForecastDB As NotesDatabase
Set thisdb = session.CurrentDatabase
Dim workspace As New NotesUIWorkspace
Dim collection As NotesDocumentCollection
Dim FCdoc As NotesDocument
Dim i3Doc As NotesDocument
Dim uiview As NotesUIView
Dim picklist As Variant
Set i3DB = session.GetDatabase("server", "db.nsf")
Set ForecastDB = session.GetDatabase("server", "db.nsf")
Call workspace.OpenDatabase( "server", "db.nsf", "view", "", False, False )
’ notesUIWorkspace.PickListStrings( type% [, multipleSelection ], server$, databaseFileName$, viewName$, title$, prompt$, column% [, categoryname$ ] )
’ picklist = workspace.PickListStrings( PICKLIST_CUSTOM, False, “server”, “db”, “view”, “pick this doc”, “prompt this”, 3)
Set collection = ForecastDB.UnprocessedDocuments
Set FCdoc = collection.GetFirstDocument
Set i3doc = New NotesDocument( thisdb )
i3doc.account = FCdoc.client(0)
Call i3doc.Save( False, False )
’ Set uiview = workspace.CurrentView
’ Call notesUIWorkspace.OpenDatabase( server$, file$, view$, key$, newInstance, temp )
’ Call notesUIDatabase.OpenView( viewName$ [, key$] [, newinstance] [, replaceView] )
End Sub