sondermark
asked on
Open View for selected documents
Hi all
Do anyone know how I can solve this problem??
I need a View action which open a view and only display selected documents.
I use the command @Command([OpenView]; "Average"), in an agent, but I cann't choose the option selected documents due to it's not legal option for @Commands
Thank in advance
Sanne
Do anyone know how I can solve this problem??
I need a View action which open a view and only display selected documents.
I use the command @Command([OpenView]; "Average"), in an agent, but I cann't choose the option selected documents due to it's not legal option for @Commands
Thank in advance
Sanne
Use a folder instead of a view:
copy the selected doc's to a folder, open it and later remove the doc's again!
copy the selected doc's to a folder, open it and later remove the doc's again!
ASKER
Hi again
This is the commands i tried to use:
@Command([RemoveFromFolder ];"Average 1");
@Command( [Folder] ; "Average1" ; "0");
@Command([OpenView]; "Average1")
- I would like to emty the folder Average1 without
select any documents - simply emty the folder.
- Then when I select som documents from a view it should
be copied to the folder Average1
- After that it should display the folder Average1
I cann't get it work with the command above - is there something wrong in these commands??
Thanks in advance
Kind regards
Sanne
This is the commands i tried to use:
@Command([RemoveFromFolder
@Command( [Folder] ; "Average1" ; "0");
@Command([OpenView]; "Average1")
- I would like to emty the folder Average1 without
select any documents - simply emty the folder.
- Then when I select som documents from a view it should
be copied to the folder Average1
- After that it should display the folder Average1
I cann't get it work with the command above - is there something wrong in these commands??
Thanks in advance
Kind regards
Sanne
Sorry Arun, only now I notice that I've copied your suggestion...
Thats okay CRAK. Thats how you get to understand how stealing works !
:)
:)
Put this code in an agent set to run "Manually from the Actions Menu" on "Selected Documents":
Dim ws As New NotesUIWorkspace
Dim s As New NotesSession
Dim uidb As NotesUIDatabase
Dim db As NotesDatabase
Dim view As NotesView
Dim doc As NotesDocument
Dim coll As NotesDocumentCollection
Set uidb = ws.CurrentDatabase
Set db = uidb.Database
Set view = db.GetView("Average1")
Set doc = view.GetFirstDocument
While Not (doc Is Nothing)
Call doc.RemoveFromFolder("Aver age1")
Call view.Refresh
Set doc = view.GetFirstDocument
Wend
'The Average1 folder should now be empty
Set coll = db.UnprocessedDocuments
Set doc = coll.GetFirstDocument
While Not (doc Is Nothing)
Call doc.PutInFolder("Average1" )
Set doc = coll.GetNextDocument(doc)
Wend
'All eligible documents should now be in the Average1 folder
Call uidb.OpenView("Average1")
Call ws.ViewRefresh
Regards,
Scott
Dim ws As New NotesUIWorkspace
Dim s As New NotesSession
Dim uidb As NotesUIDatabase
Dim db As NotesDatabase
Dim view As NotesView
Dim doc As NotesDocument
Dim coll As NotesDocumentCollection
Set uidb = ws.CurrentDatabase
Set db = uidb.Database
Set view = db.GetView("Average1")
Set doc = view.GetFirstDocument
While Not (doc Is Nothing)
Call doc.RemoveFromFolder("Aver
Call view.Refresh
Set doc = view.GetFirstDocument
Wend
'The Average1 folder should now be empty
Set coll = db.UnprocessedDocuments
Set doc = coll.GetFirstDocument
While Not (doc Is Nothing)
Call doc.PutInFolder("Average1"
Set doc = coll.GetNextDocument(doc)
Wend
'All eligible documents should now be in the Average1 folder
Call uidb.OpenView("Average1")
Call ws.ViewRefresh
Regards,
Scott
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Talking about stealing Arun.....
Yes! New guys are experts I accept. And especially Scottrma...
:-)
:-)
:-)
Okay here is an option, you are in a view and you select documents from it and if you would like to view only these selected documents alone then what you can do is, to create a folder and transfer thse selected documents to it and open the folder with the same command as open view.
Its easy. Use @Command([Folder]) to move selected documents to folder and use @command([openView]) to open the folder.
-Arun.
PS: if you are looking for something else let us know.