Solved

Counting documents in a Domino View

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …

839 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