This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal


Jan 11, 2018, 10:02 AM
3 Posts

GetAllDocumentsByKey - last value

  • Category: Domino Designer
  • Platform: Windows
  • Release: 9.0.1
  • Role: Developer
  • Tags: GetAllDocumentsByKey @dblookup
  • Replies: 4

I'm trying to incorporate something similar to @dblookup in a LotusScript Agent.
I've tried Evaluate for the @dblookup statement, but am getting nowhere.
I've read that you can use GetAllDocumentsByKey. 
Does anybody know how I can use this to return the last value in a specific column/field gathered by the collection of documents?

Jan 16, 2018, 7:49 PM
323 Posts
You're almost there with LotusScript.

Yes, as Mark says, GetAllDocumentsByKey will return the last doc in the collection. However -- this is the last document in natural order (increasing NoteIDs). Often this is the last doc created for the category -- but it's not sorted the way the view is.

If you are truly looking for the last doc *in the view category*, try GetAllEntriesByKey.

What's more, GetAll**ByKey() calls suffer from a longstanding problem introduced about R5.0.3. To avoid this problem, you *cannot* use subcategories in the view you're looking-up. Otherwise you may get the most-recent document and nothing else.

Jan 19, 2018, 11:32 AM
100 Posts
What is your question?

"Does anybody know how I can use this to return the last value in a specific column/field gathered by the collection of documents? "

Do you want the value from the last column for one, all, some, first, last, random doc?

If you need the value from all docs in the collection, then just loop through the collection and call the field for each doc.

You can use ViewEntries to get column values but I'm not sure that's any faster than looping a collection. If the collection is large, you probably want to do some time testing to see which runs faster. Speed will vary if you're running the code on the client or as a server agent.

If your collection is large, can you create a key that gives you smaller collections? Perhaps a hidden view that makes each doc unique (assuming you're wanting to get data from one and only one doc).

 


This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal