It is handy to have specific help-info available when filling in p.e. documents. For developers it is even more handier when database users make and maintain the helpdocuments and decide on which forms (documents)the help action button should appear
1) create a rol [ADMIN]as being the only person to make and maintain the helpdocuments (authors-field). Also only this person can assess a profile-document
2) Make a profile Form("Profiel"), having in a layout region a field called "choice" having a listbox with the alias-names of all the forms in the database
3) On every form there must be a computed for display text field (Form_dsp), having the alias name of the form
4) Make on every form an action with the following (universal)code:
Dim wks As New NotesUIworkspace
Dim View As NotesUIView
Dim uidoc As notesuidocument
Dim helpview As notesview
Dim session As New NotesSession
Dim db As NotesDatabase
Dim key As String, message As String, title As String
Dim doc As notesdocument
Set uidoc=wks.currentdocument
Set doc = uidoc.document
key = doc.Form_dsp(0)
Set db = session.CurrentDatabase
Set helpview = db.GetView( "Helpview" )
Set doc = helpview.GetDocumentByKey(key)
If doc Is Nothing Then
message = |There is no helpdocument for the form "|+key+|" available. Ask the person having the role [ADMIN]to make one.|
title = |Be aware!|
Messagebox message, MB_OK, title
Else
title = doc.FormName(0)
Call wks.DialogBox ("helpdocument", True, True, True, False, False, True, title, doc)
End If
5) give the action the following hide-when formula: !@IsMember(Form_dsp;@GetProfileField("Profiel"; "choice"))
4) In the Helpview the [ADMIN]can make helpdocuments for the forms
5) Using the following code on a help action button on every view helpdocuments for views can be launced:
Dim wks As New NotesUIworkspace
Dim View As NotesUIView
Dim aliassen As Variant
Dim helpview As notesview
Dim session As New NotesSession
Dim db As NotesDatabase
Dim sleutel As String, message As String, titel As String
Dim doc As notesdocument
Set View = wks.currentview
sleutel = view.ViewAlias
Set db = session.CurrentDatabase
Set helpview = db.GetView( "VinstelHelp" )
Set doc = helpview.GetDocumentByKey(sleutel)
If doc Is Nothing Then
message = |There is no helpdocument for the form "|+key+|" available. Ask the person having the role [ADMIN]to make one.|
titel = |Be aware!|
Messagebox message, MB_OK, titel
Else
titel = doc.ViewName(0)
Call wks.DialogBox ("helpdocument", True, True, True, False, False, True, titel, doc)
End If
hide-when formula: see 5
6) the [ADMIN] can make a profile document, selecting in the "choice" field on which forms a help action should appear.
Thanks to the computed for display field on documents the help button will function also on new documents (not saved yet)
This was first published in August 2002