Search DominoPower's 11,441 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.
How to create subforms that configure other subforms (continued)

Getting the setup information
Use this next bit of script in order to get the setup information.

Function GetRevHistorySetup
'This function returns the RevHistory setup document (a profile
document)
Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument

Set db = session.CurrentDatabase

'Get the link profile document. This doc is always called "RevHistory
Profile"
Set doc = db.GetProfileDocument("RevHistory Profile")

'Check that the link profile document exists...
If Len(doc.RevHistoryForm(0)) = 0 Then
Exit Function
End If

'Now get the real profile doc, as defined by the "RevHistoryForm" field
on the above doc...
Set doc = db.GetProfileDocument(doc.RevHistoryForm(0))

'Check that the real profile document exists...
If Len(doc.RevHistorySetup(0)) = 0 Then
Exit Function
End If

Set GetRevHistorySetup = doc

End Function

You can also get any field from the database setup profile document with @functions. In the example below, the intermediate profile document is called "RevHistory Profile." It contains one field called "RevHistoryForm," which is the name of the database setup profile document. Therefore, I can get the contents of the "RevisionHistorySetup" field from my setup subform.

DbSetupDoc := @GetProfileField("RevHistory Profile" ; "RevHistoryForm" );
MySetupField := @GetProfileField(DbSetupDoc; "RevHistorySetup");

Conclusion
Now you have a subform that can be configured from a setup subform on a profile document of any name, as seen in Figure B.

FIGURE B


Here's the finished RevHistory setup subform on a profile document of any name. Roll over picture for a larger image.

Since Notes stores all profile documents in memory (as opposed to on disk), there is no performance penalty. Also, since this intermediate document is only accessed by code, and never human eyes, there is no need to have an associated form. If you use Team Studio Librarian, you will get an error when you put the subform into your target document because Team Studio Librarian looks for the RevHistoryProfile form. You can safely ignore this error.

The only limitation with this approach is that the database profile document must be saved at least once before saving a document that uses the RevHistory subform. When all is said and done, however, it's a small price to pay.

Bulk reprints
Bulk reprints of this article (in quantities of 100 or more) are available for a fee from Reprint Services, a ZATZ business partner. Contact them at reprints@zatz.com or by calling 1-800-217-7874.

Chris Doig has worked with Notes for six years. He manages the Notes environment at Candescent and is currently working with Domino.Doc and the beta version of Raven. He can be reached at cdoig@candescent.com.


« Previous  ·  1  ·  2
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 > Lotus Technologies > Application Development (48 articles)
   An application for scanning physical mail and distributing it virtually
   How hide-whens in Rich Text can ruin your whole day (and what to do about it)
   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
Application development, William Shatner, and the origin of the universe
Learn Domino Designer 8.5 for free
The (near) future of Sametime, Quickr, Connections, and Symphony
Inside the IBM Innovations lab
Lotusphere 2010: Hot fixes and cool news for Notes, Domino, and LotusLive
Lotusphere 2010: mobility and collaboration
2010: A Lotusphere of change
Latest Lotus Headlines
Xpages not loading? JVM errors? - Solution
How to implement an iCalendar feed into your Notes calendar with XPages
DWA Hotfixes for Domino 8.5.1FP1 - A Gotcha
IBM Adds DB2 to Lotus Foundations SMB Package
SNTT : XPages onclick Ghosts in the machine
Ports used by Lotus Sametime 8.5 servers
Exploring a Domino Date Bug
>> Read all the news
More from the ZATZ journals
Computing Unplugged: The iPad defenders have spoken
David Gewirtz Online: CNN commentary and analysis
OutlookPower: More about disappearing text
-- Advertisement --

Learn Notes and Domino 8 at your place and pace!
Learn Notes and Domino in your office and/or home! TLCC's highly acclaimed distance learning courses for users, developers, and admins will enhance your career and your resume.

The many included activities and demos will make you a pro! Expert instructor help is a click away.

Click here to try a FREE demo course!!

-- Advertisement --

Mark your calendar for in-depth Lotus training, May 12-14, Boston
Join experts and peers May 12-14 in Boston for educational and networking events that deliver real-world Lotus training so you can increase productivity and efficiency in your company, advance your skills, and squeeze the most from your current environment. One registration gets you into THE VIEW's Admin2010 and Lotus Developer2010.

Register by April 10 to save $200.
ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
Copyright © 1998-2010, ZATZ Publishing. All rights reserved worldwide.
Editor's Login