Solved

View Selection Criteria

Posted on 2001-06-02
5
268 Views
Last Modified: 2013-12-18
Hello,

I would like to implement a query form that filter the documents based on the criteria the user enters, and display the selected documents in a view.
Is that possible with Notes?

Please note that the query form contains more than 10 fields, and they are optional. i.e. The user can select by one field only or by 10 fields.

Is there a way to specify the view Selection Criteria programatically??

Many Thanks,
Areej
0
Comment
Question by:Areej
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 9

Accepted Solution

by:
Arunkumar earned 50 total points
ID: 6149175
You cannot programmatically do the view selection but instead you could use a folder and have an action button with which you could populate the folder by using the Search Criteria on the database and getting a collection and further filtering the collection using the search on the collection and finally the end collection is putallinfolder.

If i find the link to a similar question i will post it here.

-Arun
0
 

Author Comment

by:Areej
ID: 6150805
That's wonderful..
But how to initialize the folder before moving the documents to it? How to delete the old documents from the folder before copying the new documents?

Many thanx,
Areej
0
 
LVL 5

Expert Comment

by:snocross
ID: 6152704
Here is some Lotusscript code you can use to build the folder:

Dim session As New NotesSession
     Dim db As New NotesDatabase("YourServer","YourDirectory\YourDatabase.nsf")
     Dim dateTime As New NotesDateTime( "12/01/94" )
     Dim collection As NotesDocumentCollection
     Dim BackFolder As String
     Dim UIDb As NotesDatabase
     Dim UIDoc As NotesDocument
     Set UIDb = session.CurrentDatabase
     Set UIDoc = session.DocumentContext
     BackFolder = UIDoc.Year(0)
     Set collection = db.Search( "Year = '"+BackFolder+"' & (Form = 'Whatever' | Form = 'SomethingElse')",
dateTime, 0 )
     Set doc = collection.GetFirstDocument
     While Not doc Is Nothing
          Call doc.PutInFolder( "Year_"+BackFolder+"_Results" )
          Set doc = collection.GetNextDocument(Doc)
     Wend
    REM Print("TEST")
     If collection.count >0 Then
          Print "[/YourDirectory/YourDatabase.nsf/Deal_"+BackFolder+"_Results?OpenView]"
     Else
          Print "Sorry, no results found."
     End If
     UIDoc.BuildFolder = "N"
     Call UIDoc.save(True,True)    

Now, what I do is I have a scheduled agent that removes the folders each day:

Dim SourceDb As NotesDatabase    
     Set SourceDb = New NotesDatabase("YourServer", "YourDirectory\YourDatabase.nsf")  
     Forall v In Sourcedb.views
          Set view=SourceDB.GetView(v.Name)
          If v.IsFolder Then
               'Print "Deleting folder " & v.Name
               Call view.Remove
          End If
     End Forall

Hope this helps,

-Snocross
0
 
LVL 9

Expert Comment

by:Arunkumar
ID: 6156994
Create an action button with the following code,

@Command([EditSelectAll]);
@Command([RemoveFromFolder])

Also just in the script include a little bit of code that will check the currrent folder is empty.  Just get the first document handle and prompt that the folder has to be cleared.

:-)
0
 

Author Comment

by:Areej
ID: 6215911
Many Thanx.. :-)
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question