Notes Ninjas Notes Ninjas
Lotus Notes hints, tips, error messages
Agent Log Code

Hint Short Cut: Add this to your code & documentation to help you find this page.
http://www.notesninjas.com/#agentLog or http://www.notesninjas.com/A555F9/nn.nsf/ByAlias/agentLog


Agent Log Code, this allows the agent to log details into the





 

You can do code templates in Lotus Notes 8.5

This is a code template or code snippet for an agent in lotusscript which includes error handling and logging.

 

'This agent runs daily or hourly and will blah
'01-Jan-2011 Adam Foster  First Version Adam Foster
'02-Jan-2011 Adam Foster  Production Version  

 On Error goto eh
 
 Dim s As New notessession
 Dim db As notesdatabase
 Set db=s.currentdatabase
 
 Dim aLog As New NotesLog("Agent Log")
 Call aLog.OpenAgentLog
 Call aLog.LogAction("Starting " & Now)
 

 'Enter your code here

 Call aLog.LogAction("Finishing " & Now)
 Call aLog.Close
 
 End

eh:
 Call aLog.LogAction("Error " & Error$ & "(" & Err & ") at line " & Erl )
 Call aLog.Close

 

 

 

 

 Jump to:     Notes Tips
    Lotus Notes Index 
  Register for Tips
Previous Lotus Notes Tip 
    Next Lotus Notes Tip
Your company logo here?
Adam Foster
Free Cash Making Web Site
Free Revenue Earning Blog Site
 Free Revenue Earning Newsletter Site   
Free Search Pages Free Web stats
Free Contact Us page
Cheap .com domain names
 Need a website or 
   Lotus Notes
  problem solved?
Adam Foster
Web Services Platform Architecture: Soap, WSDL, WS-Policy, WS-Addressing, WS-Bpel, WS-Reliable Messaging and More by Francisco Curbera, Frank Leymann, Tony Storey, Donald Ferguson, Sanjiva Weerawarana
Other books claim to present the complete Web services platform architecture, but this is the first one I've seen that really does. The authors have been intimately involved in the creation of the architecture. Who better to write this book?
See at: Amazon.co.uk | Amazon.com |