|
you need to be careful of repeating meetings as the original is required. here is the script to use import lotus.domino.*; import java.util.Vector; public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(); AgentContext agentContext = session.getAgentContext(); Database db = agentContext.getCurrentDatabase(); View view = db.getView("$Meetings"); // Open the Meetings view String subject; String repeats; DateTime createdon; // when the message was created DateTime nowDateTime = session.createDateTime("Today"); //the date right now int daysSinceCreated = 0; nowDateTime.setNow(); Document doc = view.getFirstDocument(); while (doc != null) { createdon = doc.getCreated(); subject = doc.getItemValueString("Subject"); repeats = doc.getItemValueString("Repeats"); if (repeats == null) repeats = "0"; System.out.println("\n" + doc.getCreated().getLocalTime()); daysSinceCreated = nowDateTime.timeDifference(createdon) / 86400; // find number of days ago message created System.out.println("Meeting \"" + subject + "\" was created " + daysSinceCreated + " days ago."); System.out.println("Repeats = " + repeats); if ( (daysSinceCreated > 14) && ( repeats.equals("0") ) ) { System.out.println("\"" + subject + "\" removed"); doc.remove(true); //remove the document doc = view.getFirstDocument(); } else doc = view.getNextDocument(doc); } } catch(Exception e) { e.printStackTrace(); } } } Walter Scanlan Senior Software Engineer Domino For iSeries Internet WSCANLAN@xxxxxxxxxx CLP R4, R5 and Domino 6 Phone 507-286-6088
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.