Domino Code Fragment

Code Name*
NumErrors property
Date*
04/28/2024
Source (or email address if you prefer)*
Rlatulippe@romac.com
IP address:.18.191.189.85
Description*
This agent prints the number of the error number in the log message.
Type*
Java
Categories*
(Misc)
Implementation:
Required Client:
Server:
Limitations:
Comments:
Files/Graphics attachments (if applicable): Code:
import lotus.notes.*;
import java.util.Vector;


public class numerrorsagent extends AgentBase
{
 public void NotesMain()
 {
   try
   {
     Session s = getSession();
     Log log = s.createLog("Counting agents");
     Vector v = new Vector();
     v.addElement(s.getUserName());
     log.openMailLog(v, "Here's your log");
     log.logError(0, "Error number " +
     (log.getNumErrors()+1));
     log.logError(0, "Error number " +
     (log.getNumErrors()+1));
     log.logError(0, "Error number " +
     (log.getNumErrors()+1));
     log.close();  
   }
   catch (Exception e)
   {
     e.printStackTrace();
   }
 }
}