Solved

Counting documents in a Domino View

Posted on 2016-10-27
3
115 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 500 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

This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…

726 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