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