Solved

Counting documents in a Domino View

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Order table with macro 3 75
countX 22 70
How Complex Is This Java Course ? 9 62
Code for extraction to mkdir folder 5 32
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
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…

708 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now