Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 214
  • Last Modified:

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
0
sondermark
Asked:
sondermark
  • 3
  • 3
  • 3
  • +1
1 Solution
 
ArunkumarCommented:
How do you select documents first of all ???

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.
0
 
CRAKCommented:
Use a folder instead of a view:
copy the selected doc's to a folder, open it and later remove the doc's again!
0
 
sondermarkAuthor Commented:
Hi again

This is the commands i tried to use:

@Command([RemoveFromFolder];"Average1");
@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
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
CRAKCommented:
Sorry Arun, only now I notice that I've copied your suggestion...
0
 
ArunkumarCommented:
Thats okay CRAK. Thats how you get to understand how stealing works !

:)
0
 
scottrmaCommented:
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("Average1")
     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
0
 
scottrmaCommented:
Sorry, try this one instead:

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("Average1")
    Call view.Refresh
    Set doc = view.GetFirstDocument
Wend

'The Average1 folder should now be empty

Set db = s.CurrentDatabase
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

The only difference here is that I added the line:

Set db = s.CurrentDatabase

because I am not sure if the NotesDatabase.UnprocessedDocuments property returns anything if you got the handle to NotesDatabase through the NotesUIDatabase.Database property.

Regards,

Scott
0
 
CRAKCommented:
Talking about stealing Arun.....
0
 
ArunkumarCommented:
Yes!  New guys are experts I accept.  And especially Scottrma...

:-)
0
 
scottrmaCommented:
:-)
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 3
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now