?
Solved

Counting documents in a Domino View

Posted on 2016-10-27
3
Medium Priority
?
155 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: 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

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Introduction to Processes
Suggested Courses

770 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