The Lotus Notes Online Help claims that it can be done, and I followed
their example to a T. That didn't work, but after trying different
things, I did get it to work and was able to retrieve the number of
documents in the view that match the search criteria.
BUT HOW DO I FILTER THE VIEW? I even used doc.GetFirstDocument, but that
didn't do anything. I'm conducting this search from an Action button.
Any examples or ideas...anyone? Below is the code I'm using. I'm
desperate. It's Thanksgiving, and I've pulled an all-nighter.
Dee Philipp
e-mail: bing...@usa.net
====================================================================
ACTION BUTTON SCRIPT:
====================================================================
Sub Click(Source As Button)
Dim session As New NotesSession
Dim db As NotesDatabase
Dim j As Integer
Dim johnny As NotesView
Dim doc As NotesDocument
Dim num As Integer
Set db = session.CurrentDatabase
' If db.IsFTIndexed Then
' Messagebox "Is full text indexed " _
' & db.LastFTIndexed
' Else
' Messagebox "Database is not full text indexed."
' End If
Set johnny = db.GetView( "By _Author" )
j = johnny.FTSearch( "five", 0 )
Set doc = johnny.GetFirstDocument
' BUT NOTHING HAPPENS...THE VIEW DOESN'T CHANGE!
If j > 0 Then
Messagebox "Found something...somewhere." & Str$(j)
End If
End Sub
=======================================================================
My situation allowed me to place the value I wanted to seach, a ship name,
in the first column of the view (remember you can have another view which
shows the data in a search specific order but it is not the one the 'client'
sees) ordered in ascending order (or whatever). You then use
GetAllDocumentsByUniqueKey, which would have the Ships Name passed to it and
it would pull out all documents into a collection whether the Full Text
index was current or not.
In your case it may be a persons name, a department or an ID number, the
principle is the same, put that field in the first column, index it and then
pass the value to GetAllDocumentsBuUniqueKey - I nearly prayed for
delieverence when I found this command.
Hope it helps!!!
Dee Philipp wrote in message <365D61...@email.com>...
John Knezevich
CLP
You're getting the backend view, which won't effect what the user sees
I've done this in the past for a similar request.
1. Prompt user for selection value & store in an evironment var 2. Run a
selection agent that selects all docs meeting the criteria from the var. 3.
Run a "run once @commands may be used" agent that has the command formula
ViewShowOnlySelected. 4. Give them a toggle button to turn it off.
If the selection value is always the same you can omit step 1.
Gary
In article <365D61...@email.com>,
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
This is probably too late now, but I hit a similar problem when I was
attempting to filter views to certain documents only. In the end, I put in
a logical field in the document, wrote a routine in script that reset the
value to False for all documents, then set it to True only for the documents
that met the conditions of the time (in this case if the body contained a
phrase the user had typed into a field in a custom 'search' form), and then
changed the select condition for the view to only show documents where the
logical field was set to True. That worked out well for me.
Dee Philipp wrote in message <365D61...@email.com>...