Search DominoPower's 11,323 Lotus-related article archive 
Home
EasyPrint
News details Click here for the RSS feed's XML code. This is not a browser URL.
Articles-only Click here for the RSS feed's XML code. This is not a browser URL.
Twitter Feed Click here for the Twitter feed.
PROGRAMMING POWER
New Release 5.0 classes: NotesViewEntryCollection and NotesViewEntry
By Tony Patton

This month we continue the coverage of LotusScript enhancements in Domino 5.0. We focus on two new classes: NotesViewEntryCollection and NotesViewEntry. These classes allow you to work with individual elements in a view.

Using the NotesView class in Notes 4.x
In Notes 4.x, the NotesView class could be used to access documents in a view. The example below demonstrates using it to scroll through all documents in a view.

Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim view As NotesView
Set db = session.CurrentDatabase
Set view = db.GetView("viewName")
Set doc = view.GetFirstDocumetn
While Not (doc Is Nothing)
... code to work with document ...
Set doc = view.GetNextDocument(doc)
Wend

The NotesView class works well, but it only allows you to access documents in a view. In addition to documents, a view can contain categories and totals.

Using the Release 5.0 NotesViewCollection class
This is where the NotesViewCollection class comes into play. It lets you access all elements in a view, and it can tell you various characteristics of each element.

The next example demonstrates putting the NotesViewEntryCollection class to use.

Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim vecoll As NotesViewEntryCollection
Dim entry As NotesViewEntry
Set db = session.CurrentDatabase
Set view = db.GetView("viewName")
Set vecoll = view.AllEntries
Set entry = vecoll.GetFirstEntry
While Not (entry Is Nothing)
... code to work with view entry object...
Set entry = vecoll.GetNextEntry(entry)
Wend

As you can see, the NotesViewEntryCollection works the same as a NotesDocumentCollection. You set the NotesViewEntryCollection using the AllEntries property of the NotesView object. Once the object is set, you can scroll through all entries using the GetFirstEntry and GetNextEntry properties of the NotesViewEntryCollection object. These methods return a NotesViewEntry object.

Using the NotesViewEntry class
The NotesViewEntry class contains numerous properties and methods that signal the characteristics of the entry.

Table A below shows the properties that exist for NotesViewEntry objects.

Property Description
ChildCount Contains the number of children in the entry.
DescendantCount Contains the number of entries under the current entry.
IndentLevel Contains the number of levels the current entry is indented.
IsCategory Signals true or false whether the entry is a category or not.
IsDocument Signals true or false whether the entry is a NotesDocument object or not.
IsTotals Signals true or false whether the current entry contains totals or not.
SiblingCount Contains the number of entries at the same level of the current entry.
Document Contains the NotesDocument object of an entry, if it is a NotesDocument.


1  ·  2  ·  Next »
Other articles you might like
Home > Lotus Technologies > LotusScript (64 articles)
   When the debugger won't debug hidden code that isn't hidden
   What to do if the LotusScript debugger won't single-step over code
   Little known traps about Lotus Notes fields
Get Weekly Email Updates
Subscribe to our regular weekly email newsletter. It's packed with tips, reviews, deep analysis, and the latest news.
 
Recent DominoPower Articles
Lotusphere 2010: mobility and collaboration
2010: A Lotusphere of change
Five trends for 2010
DominoPower TV Episode 1: Inside a strategy session with Teamstudio
More about Domino log files
Say goodbye to the Uh-Ohs. Long live the Tens.
Why your log.nsf might not be purging properly
Latest Lotus Headlines
Recommended Maintenance - Lotus Notes Traveler
Here are the slides and other materials from our Lotusphere session
Microsoft OCS awareness in Lotus Connections and Websphere Portal?
SnTT: XPages Blank Calendar Control (Part 2), adding data
Have your Lotus Notes calendar display multiple time zones
Sample Database for Microsoft Office and Lotus Symphony Integration
Symphony 3.0 beta signals another attack on Office
>> Read all the news
More from the ZATZ journals
Computing Unplugged: The iPad: Apple's latest heartbreaker
David Gewirtz Online: CNN commentary and analysis
OutlookPower: Running auto-respond rules when Outlook is closed
-- Advertisement --

Power Tools 6.0 is a set of 90 administrative utilities for Lotus Notes & Domino
Power Tools simplifies management of the Notes/Domino environment by automating routine tasks. Power Tools can manage or monitor mail files, groups, ACLs, agents, LOG.NSF, templates and more.

Download a trial version from helpsoft.com.
-- Advertisement --

Struggling with exporting Notes data to spreadsheets? No More!
Try IntelliPRINT, The world's leading Reporting, Dashboards, and Analysis solution for Notes & Domino

  • Don't spend unproductive time maintaining different versions of the same spreadsheet
  • Preserve data integrity and security in multi-user environments
  • Create reports in minutes INSIDE Notes
  • Get freedom from iterative report requests, deliver self-serve capabilities

Experience Reporting, Dashboards, and Analysis INSIDE Notes.

Try IntelliPRINT NOW!

ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
Copyright © 1998-2010, ZATZ Publishing. All rights reserved worldwide.
Editor's Login