Email:   


Home
In This Issue
Email a Friend
EasyPrint
Click here for the RSS feed's XML code. This is not a browser URL.


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. Click 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.




[ Prev ]

-- Advertisement --

2-Minute Tutorials
How do I...

  • integrate MS Office or OpenOffice with Notes?
  • create cross-tab reports and charts?
  • print serial letters and mailing labels?
  • create PDFs in Lotus Notes?


Check out the 2-minute tutorials here.
-- Advertisement --

Now for the first time, real-time dashboards within Notes!
No more tedious report iteration and endless data exporting! The New IntelliPRINT Dashboard Reporting now empowers you to easily create analyzable widgets and real-time dashboard reports. Your business managers can then quickly customize, extend, and analyze these dashboards to their heart's content!

All from within your Lotus Notes data, all in real-time!

Download your Free Trial today!

Copyright © 1998-2008, ZATZ Publishing. All rights reserved worldwide.