Creating Disclaimers for Different Business Units

It is easy implementing a automatic disclaimer for you company. But what do you do when the business do not want

the diclaimer underneath official business mail, or each business unit within the company need to have a different business disclaimer containing e.g. different directors for each business unit. They even have a choice of language for the ooficial diclaimer - depending on the language of their client!

This tip will show you how to create a automatic disclaimer containing either the default company disclaimer, or an Official disclaimer and let users choose the default business unit and language and change it any time they need.

This code will create a table at the top of each mail memo (or reply form). When the user first enters Notes the default diclaimer will be the "DEFAULT DISCLAIMER TEXT" (used for users sending mail to friends etc.)

The user can select between Default or Official Disclaimer, depending on the contents of the mail. Once Official Disclaimer are selected, another choice appears for the user to select the business unit to which he belongs, as well as the language of choice. All of these choices are saved in Environment variables in the Notes.ini so the user only has to switch between Official mail or default mail.

Do the following on all 3 forms:Memo form; Reply form and Reply with History form:
-- Add a hidden field: disclaimer with default value 0. (0 = No disclaimer has yet been added, 1= disclaimer already added). This prevents the disclaimer from being added more than once e.g. when mail adressing errors occur etc.
-- Add Disclaimer table at the top of the form with the following fields:

Radio button field with values "Yes" or "No". If this is the first time the user use this template, set the default for OfficialMail to "No", else get the previously used values from the environment variables in the Notes.ini.
Default Value: @If(@Environment("OfficialMail") = "";"No";@Environment("OfficialMail"))
This field is hidden when OfficialMail = "No"
Allow the user to select his Business Unit for Official Mail. Dialog list containing all official business units (D,E,F,G). The default business unit is "G", or get the previously used value from the Notes.ini environment variable "OfficialGroup"
Default value: @If(@Environment("OfficialGroup") = "";"G";@Environment("OfficialGroup"))
Radio button field with language choices - in this case English or Afrikaans
This field is hidden when OfficialMail = "No"
Allow the user to select his choice of language for his client. The Default is "English" or get the previously used value from the Notes.ini environment variable "OfficialLang"
Default Value: @If(@Environment("DisclaimerLang") ="";"English";@Environment("DisclaimerLang"))

Some users are not allowed to use the Official Disclaimer. The table is hidden for them and the default disclaimer will be added to all mail sent by them. In this case the distinction is made on the OU2 field:
-- Make the table hidden when ou2="A", "B","C" etc.
-- In the PostOpen event add the following code:
If userName.IsHierarchical Then
ou = username.orgunit2
If ou = "" Or ou = "A" Or ou = "B" Or ou = "C" Then
Call uidoc.fieldSetText("OfficialMail", "No")
Call uidoc.fieldSetText("DisclaimerLang", "English")
Call uidoc.Refresh
End If
End If

Now that we have all the information we need to add the disclaimer, we add the following code to the QuerySave Event of the form (remember the Memo form, Reply Form AND Reply with History form):

Dim ws As New notesuiworkspace
Dim uidoc As notesuidocument
Dim Disclaimer As String
Dim OfficialMail As String
Dim OfficialGroup As String
Dim DisclaimerLang As String
Dim session As New notessession
Set uidoc = ws.currentdocument
Set doc = uidoc.document
'Get the values for the disclaimer from the front-end document:
OfficialMail = uidoc.FieldGetText( "OfficialMail" )
OfficialGroup = uidoc.FieldGetText( "OfficialGroup" )
DisclaimerLang = uidoc.FieldGetText( "DisclaimerLang" )
'Save the values in the NOtes.ini so that the user only has to choose once
Call session.SetEnvironmentVar("OfficialMail",OfficialMail)
Call session.SetEnvironmentVar("OfficialGroup",OfficialGroup)
Call session.SetEnvironmentVar("DisclaimerLang",DisclaimerLang)

Disclaimer = ""
'Do this only if the discaimer has not been added to the mail yet:
If uidoc.fieldgettext("Disclaimer") = "0" Then
'The user do not want to use the official diclaimer:
If OfficialMail = "No" Then
'For the official diclaimer, determine the language set by the user:
If DisclaimerLang = "A" Or DisclaimerLang = "Afrikaans" Then Disclaimer = |OFFICIAL DISCLAIMER IN AFRIKAANS.|

End If
'Determine the Business Unit and add the Directors for the business unit to the dislcaimer field already build up in the correct language:
Select Case OfficialGroup
Case "D"
Disclaimer = Disclaimer & |

Directors for Business Unit D.|
Case "E"
Disclaimer = Disclaimer & |

Directors for Business Unit E.|
Case "F"
Disclaimer = Disclaimer & |

Directors for Business Unit F.|

Case Else
Disclaimer = Disclaimer & |

Directors for Business Unit G.|
End Select

End If
'Add a line at the top of the disclaimer to ditinguish between mail text and disclaimer text:
Disclaimer = |

| & Disclaimer
'Now add the disclaimer to the bottom of the mail:
Call uidoc.fieldappendtext("Body", Disclaimer)
'Change the value of the hidden disclaimer field to ensure disclaimer only set once:
Call uidoc.FieldSetText("Disclaimer","1")
End If

And wholla: an easy system that can also be changed easily to incorporate new business units or changes to any of the disclaimers or directors.

This was first published in March 2001

Dig deeper on Domino Resources - Part 3



Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:



  • iSeries tutorials's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...