Skip to main content
Information Mgmt
New to Lotus
How to buy
Live demos
Technical library
Forums & community
Java™ technology
Open source
SOA and Web services
Web development
My developerWorks
About dW
Submit content

developerWorks  >  Lotus  >  Forums & community  >  Notes/Domino 4 and 5 Forum

Notes/Domino 4 and 5 Forum



RE: Tell if document being opened from doclink?
Kevin Pettitt 5.Nov.03 09:25 PM a Web browser
Domino Designer -- LotusScript 5.0.4 Windows NT

Just figured out a way to do this by turning the whole thing around. I can't directly tell if a doc was arrived at via a doclink, but I CAN mark a document as having been opened from a view. Documents lacking such a mark can be assumed to have been accessed through a doclink.

I put the following code in all of the view QueryOpenDocument events:

Sub Queryopendocument(Source As Notesuiview, Continue As Variant)
Dim dc As NotesDocumentCollection
Dim doc As NotesDocument
Set dc = Source.documents '(this is the part that surprises people)
Set doc = dc.getfirstdocument 'only 1 document
doc.OpenedFromView = "Y"
Call, False)
End Sub

Then in the QueryClose events of all the forms that may appear in all these views (or better yet, create a subform and include it in all forms), including the following cleanup code:

Sub Queryclose(Source As Notesuidocument, Continue As Variant)
Dim doc As NotesDocument
Set doc = Source.document
If doc.HasItem("OpenedFromView") Then
Call doc.RemoveItem("OpenedFromView")
Call doc.Save(True, False, True)
End If
End Sub

Of course, this approach means that the internal last modified date and Modified by properties of the document will be updated, so if you have any functionality driven by these values, you'll have to recode a bit. This also doesn't work for folks lacking edit access to the document, but I think that could probably be overcome using a variation of the agent.runonserver approach that LDD Today has an article about.

The value of this approach for my purposes is that I can add code to the Queryclose of the document form that will reopen the source database when a doclink document is closed, but not when a view-accessed document is closed. This overcomes the problem of losing context when you access a document via a doclink and then can't find the database that contained it.


Tell if document being opened from ... (Annette Braet 12.Sep.00)
. . RE: Tell if document being opened f... (Kevin Pettitt 5.Nov.03)

  Document options
Print this pagePrint this page

 Search this forum

  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Advanced search

 RSS feedsRSS
All forum posts RSS
All main topics RSS
More Lotus RSS feeds

Forum use and etiquette
Native Notes Access
Web site Feedback

  Lotus Support
Lotus Support
Product support pages index
Search knowledge base (Technotes)
Search support downloads
Lotus Support RSS

IBM Composite Applications
IBM Mashup Center
IBM Connections
IBM Docs
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud for Social Business
IBM Web Experience Factory
Lotus Domino
Lotus Domino Designer
Lotus Expeditor
Lotus Foundations
Lotus iNotes
Lotus Instructor Community Courseware
Lotus Notes
Lotus Notes & Domino Application Development
Lotus Notes Traveler
Lotus Protector
Lotus Quickr
Lotus Symphony
IBM Web Content Manager
WebSphere Portal

 Lotus Forums
Notes/Domino 9.0
Notes/Domino 8.5 + Traveler
Notes/Domino XPages development forum
Notes/Domino 8
Notes/Domino 6 and 7
Notes/Domino 4 and 5
IBM Connections
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud Notes
IBM SmartCloud Meetings
IBM Web Content Manager
Lotus Domino Document Manager
Lotus e-learning
Lotus Enterprise Integration
Lotus Expeditor
Lotus Protector
Lotus Quickr
Lotus SmartSuite
Lotus Symphony
Lotus Symphony Developer Toolkit Support
Lotus Workflow