Home > Domino Tips > Administrator > Database > Print a greeting in the status bar
Domino Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

DATABASE

Print a greeting in the status bar


Geert Broeckx
08.07.2001
Rating: --- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


The following code prints a greeting in the status bar when a user enters a database, creates a document at the same time, and prints a goodbye greeting in the status bar when a user exits the database. This can be used by the administrator or developer to track when and who has accessed the database.



Code

  1. Place this code in the Postopen event of the Database Script:

    @Command([ToolsRunMacro];"(Salutations)")
  2. Create the agent Salutation with Manually from Agent List set. The agent prints the salutations at the bottom of the status bar based on the time of day (either, morning, afternoon, evening or night). Then it gets the name of the user and creates a history document. The form has only two fields, a UserName field and a CreatedOn field.

    Sub Initialize
    
    Dim HistoryDoc As NotesDocument
    Dim user_name As String
    Set session = New NotesSession
    Set db = session.CurrentDatabase
    Set ws = New NotesUIWorkspace
    Set UIdoc = ws.CurrentDocument
    
    user_name = session.CommonUserName
    If Hour(Time) > 0   And Hour(Time)  < 12 Then Print 
    "Good morning " & user_name  & " and welcome back."
    If Hour(Time) > 12  And Hour(Time)  < 17 Then Print 
    "Good afternoon " & user_name  & " and welcome back."
    If Hour(Time) > 17  And Hour(Time)  < 20 Then Print 
    "Good evening  & user_name   & " and welcome back."
    If Hour(Time) > 20  And Hour(Time)  < 23 Then Print 
    "Good night " & user_name  & " and welcome back."
    
    Set HistoryDoc = New NotesDocument(db)
    HistoryDoc.Form = "FM_UserEnterDatabase"
    HistoryDoc.UserName =  user
    HistoryDoc.CreatedOn = Today
    
    Call HistoryDoc.Save(True,False)
    End Sub
  3. Place this code in the Queryclose event of the Database Script.

    Dim session As New NotesSession
    Dim user As String
    
    user = session.CommonUserName
    Print "Goodbye " & user  & " and have a nice day."

Rate this Tip
To rate tips, you must be a member of SearchDomino.com.
Register now to start rating these tips. Log in if you are already a member.


Submit a Tip




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
Database
LotusScript code rebuilds corrupted busytime.nsf file
How to move Notes databases off Domino 8 servers and save disk space
Top 10 Lotus Notes/Domino administration tips of 2008
Batch file runs scheduled Lotus Notes database maintenance tasks
Fix and update Lotus Notes documents with limited access
Programmatically replace the design of Lotus Notes databases
Add a program doc to compact Lotus Notes databases automatically
More efficient local Lotus Notes database replication
Remove orphaned Lotus Notes documents on Domino databases with a 'virtual delete'
Detect and fix 'Manager' access control list settings in Lotus Notes Domino

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



Domino & Lotus Notes Security Solutions: Authentication, Antispam, Encryption and Antivirus
HomeTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersDomino IT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts