Search DominoPower's 10,675 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
Troubles with views
By Mick Moignard

Here's a short piece with some tips on using Notes views programmatically from LotusScript. And it may be a first for DominoPower: it was written entirely with the Notes 8 document editor.

We had an interesting error come up in one of our project's agents last week, one that took us a little while to work out what the cause was. The agent is one that's run by hand from the Actions menu, and is intended to operate on the document under the highlight bar in the view that's open. That's usually one of a number of views that shows main documents and some of the responses to them. Sadly, this isn't the only problem report against this agent, but it was one that vexed us for a couple of hours while we tried to work it out.

The problem was this: when it was run against the default view, it worked just fine. Being the default view, that's how it was usually run. But if it was run against one of the other views, it failed with a 4151 error -- NOTES_DOC_NOTINVIEW, when to all appearances, the document in question was in the view -- because, of course, it was the one highlighted.

You can imagine that we puzzled on this for a while. Here's a simplified version of the code that shows the gist of it:

dim sess as new NotesSession
dim db as NotesDatabase
dim unProcesseddocs as NotesDocumentCollection
dim view as Notesview
dim maindoc as NotesDocument
dim child as NotesDocument

set db = sess.CurrentDatabase
set view = db.GetView("defaultView")
set unProcesseddocs = db.GetUnprocessedDocuments
set maindoc = docs.GetFirstDocument

set child = view.GetChild(maindoc)

It was on that last getChild statement that the failure occurred, when we started from a view that was not the default view. We read the help documentation about getChild. We ran the code in the debugger. We could see that maindoc has been instantiated. We could see maindoc in the view we started from -- obviously, because we started from it. We could also see it in the default view. And we checked that by UNID to be absolutely sure.

It became clear that the problem had to be how "maindoc" was identified when passed to view.GetChild, and as we explored with the debugger, we started to understand the problem.

When you get a document from the db.UnprocessedDocuments collection, it comes with the ParentView property set to the view that was displayed when the agent was started -- which, by the way, is contrary to what the help says. It says "If the document was retrieved directly from a database or a document collection, the ParentView property returns Nothing."


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
Home > Tips & Techniques (95 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
   Troubleshooting an OpenSuse Notes install
Home > Lotus Technologies > Application Development (47 articles)
   How hide-whens in Rich Text can ruin your whole day (and what to do about it)
   Little known traps about Lotus Notes fields
   Integrating a Notes Connector database with Google Enterprise Search
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
What to look for in a Domino-based document management solution
Understanding Domino.doc end-of-life options
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
Top 10 ways to launch and build a Lotus consulting practice (with a little help from the Beatles)
Troubleshooting an OpenSuse Notes install
Incident report: denial of service attack against ConnectedPhotographer.com
Latest Lotus Headlines
SnTT - Enabling ALL the bells and whistles!
Tivoli Data protection causes Domino to crash
Fun when running DB2 CLP scripts
Introducing Flippr, the easy way to admin Quickr
DXL and fake security
Using search forms in IBM Workplace Collaborative Learning 2.7
Schmidt, Freed, and Gering on the OVF Toolkit
>> Read all the news
More from the ZATZ journals
Computing Unplugged: Eight steps to successful and reliable home backups
David Gewirtz Online: CNN commentary and analysis
OutlookPower: Can Outlook run when it's not running (and other mysteries)?
-- Advertisement --

PDF Conversion for Lotus Notes
Convert Lotus Notes documents to PDF for sharing, archiving or web printing.

  • 1-step PDF: As easy as clicking a Lotus Notes toolbar icon
  • Archive email folders or views as a self-contained PDF
  • Convert any document collection into a PDF file
  • Produce print-quality output from Web applications
  • Client side or Server side conversion
  • Doesn't require any DLL files
  • LotusScript API for developers


Ready to learn more?
-- Advertisement --

Easy Domino Access: Remove Passwords, End Login Prompts, Reduce Password Management
PistolStar's Password Power provides browser-based single sign-on to Lotus Domino, Sametime and Quickr with the enhanced security of the Kerberos or NTLM authentication protocol.

  • Full support available for NTLM authentication protocol in non-Active Directory environments
  • Seamlessly integrate Microsoft Active Directory and the Kerberos authentication protocol
  • Leverage Active Directory password policies to unify Lotus applications


Learn more about Password Power's powerful, advanced functionality.
ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
Copyright © 1998-2009, ZATZ Publishing. All rights reserved worldwide.
Editor's Login