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



Apr 8, 2014, 2:52 PM
51 Posts

getAllEntriesByKey method

  • Category: Server Side JavaScript
  • Platform: Windows
  • Release: 8.5.3
  • Role: Administrator
  • Tags: Multiple category view
  • Replies: 4

Hi,

I am trying to retrieve entries count of a multiple category view of Xpage using key value, but i could not possible.  anyone please check my code below what was the wrong .

Here i would like to get all the entries count based on my view first category "Year" and the subcategory "Month" as key values.

var db = session.getCurrentDatabase()
var v:NotesView = db.getView("(ticket_all_bymonth)")
var query = new java.util.Vector();
var y="2014"
var m="March"
query.addElement(y);
query.addElement(m);
//var vec:NotesDocumentCollection = v.getAllDocumentsByKey(query);
var vec:NotesViewEntryCollection = v.getAllEntriesByKey(query);
return vec.getCount().toFixed()

Thanks.

Apr 8, 2014, 2:49 PM
366 Posts
I believe this code does not work

i ran into this this past week as well.  It would find "some" but not all of the categories.  There seems to be a bug in this method going back to 8.5.3.  Needs to be SPR'd.

 

I had to create a flat view and that worked.

Apr 9, 2014, 9:48 AM
298 Posts
*Correct, it only finds the first category not all of them
Apr 9, 2014, 1:17 PM
54 Posts
NotesDocumentCollection works

If you use

var vec:NotesDocumentCollection = v.getAllDocumentsByKey(query);

instead of

var vec:NotesViewEntryCollection = v.getAllEntriesByKey(query);

you will get the correct number of documents.

Apr 14, 2014, 12:58 PM
51 Posts
NotesDocumentCollection works

I tried this way also

var vec:NotesDocumentCollection = v.getAllDocumentsByKey(query);

But no use..


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