?
Solved

Counting documents in a Domino View

Posted on 2016-10-27
3
Medium Priority
?
199 Views
Last Modified: 2016-10-27
Hi All

I have an embedded view that shows documents with the same key as the parent form.  I need to have a count in a field on the parent form of the number of documents in the view.

The complication being this embedded view shows only the parent document responses, but of course in reality the view has documents from all parents in it.

Your help is appreciated.
0
Comment
Question by:nigelboyle
  • 2
3 Comments
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 41862190
So you want the total number of documents in the View?

Easiest way is to use LottusScript (or Java). From the Designer Help database:

  Dim session As New NotesSession
  Dim db As NotesDatabase
  Dim view As NotesView
  Dim nav As NotesViewNavigator
  Set db = session.CurrentDatabase
  Set view = db.GetView("By category")
  Set nav = view.CreateViewNav()
  Messagebox nav.Count,, "Number of entries in view"
  

Open in new window

0
 

Author Comment

by:nigelboyle
ID: 41862258
Many thanks Sjef.  My left hand column is a key which matches a key in the parent document. What would I need to add to say ' count the docs only where the key matches?'

Your points if I get the part of the solution!! :)

Thanks again.
0
 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 2000 total points
ID: 41862287
Then there are a few solutions.

1) Assuming the view is categorized:
     Set nav = view.CreateViewNavFromCategory("Burgundy")
    and use nav.Count

2) Assuming the view is sorted or categorized:
     Dim dc As NotesDocumentCollection
     Set dc= view.GetAllDocumensByKey("Burgundy", True)
   and use dc.Count

3) the old way, using Formula language:
     @Count(@DbLookup("";"";"view";"Burgundy";1))

And how many points for 3 solutions? ;-)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Introduction to Processes

809 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