Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GetAllDocumentsByKey not returning right value

Status
Not open for further replies.

doritos93

IS-IT--Management
Apr 19, 2010
1
CA
Hello everyone,
I'd like to preface my post by saying that I have very limited knowledge of databases and LotusScript.

I'm using VBA to read Lotus Documents. I have a View whose columns are organized in the following manner:

Email Quantity - Customer Service Agent Name - Year - Month - Day - Hour - Recipient Name - Subject

This View is used to monitor how many emails each agent sends out and also provides a way to sample each of the agents emails. strSearchKey = Customer Service Agent Name

Code:
...    
Set NotesView = MailDb.GETVIEW("Stats\Envoyé par Agent")
Set NotesDocumentCollection = NotesView.GetAllDocumentsByKey(strSearchKey)
MsgBox (NotesDocumentCollection.Count)
Set DocumentA = NotesDocumentCollection.GETFIRSTDOCUMENT
...

The "Count" method returns 2, which is only the number of documents in the first hour on the first day my "strSearchKey" occurs.

I know I am supposed to be using an array of keys, but the only thing I need to find is all the email sent by a certain Agent.

Do I need to ask the admin to change the View in Lotus so that the agent name is the first column? I tried FTSearch although the server responds that I have exceeded the number of queries in a temporary index search or something like that.

Again, sorry my beginners explanation and thank you for any help.
 
Views in Notes have a hierarchical notion, from leftmost to rightmost position. That means that, in a view whose first column in Email Quantity, the prime column for searching is Email Quantity.
You are searching on a different value than the first column, that is one problem I can think of.

The second problem is the fact that Email Quantity is most probably a "count" column, meaning the column is designed to simply count the number of documents. It is contrary to Notes design practices to have a count column in first position - generally count columns are put after all categorized columns. So, unless no columns are categorized in that view, which I somehow doubt given the names of the other columns, the count column is in the wrong place. From my point of view, the Customer Service Agent Name should come first. In fact, I would put the count column just before the Subject column. That maximizes Notes functionality for that column.
Of course, that is only my opinion based purely on anecdotal data and without any access to the design specifications, but still, it feels wrong.

Pascal.

I've got nothing to hide, and I'd very much like to keep that away from prying eyes.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top