getEntries (NotesCalendar - JavaScript)

Gets calendar entries within a given time range.

Defined in

NotesCalendar

Syntax

getEntries(start:NotesDateTime, end:NotesDateTime) : java.util.Vector

getEntries(start:NotesDateTime, end:NotesDateTime, skipcount:int, maxreturn:int) : java.util.Vector

Parameter Description
start The start time of the entries.
end The end time of the entries. An exception occurs if the end time is not greater than the start time.
skipcount The number of entries to skip before starting the get operation. Defaults to 0.
maxreturn The maximum number of entries to return. If skipcount and maxreturn are not specified, all entries in the range are returned.
Return value Description
java.util.Vector The calendar entries in the range, or an empty vector for no entries. Each vector element is of type NotesCalendarEntry.

Usage

Use the last two parameters in conjunction with EntriesProcessed to process entries in successive operations. See EntriesProcessed for an example using the last two parameters.

Examples

This button event displays the calendar entries for today and tomorrow.
var dbdir:NotesDbDirectory = session.getDbDirectory("");
var maildb:NotesDatabase = dbdir.openMailDatabase();
var cal:NotesCalendar = session.getCalendar(maildb);var dt1:NotesDateTime = session.createDateTime("Today 08");
var dt2:NotesDateTime = session.createDateTime("Tomorrow 17");
var entries:java.util.Vector = cal.getEntries(dt1, dt2);
for (i = 0; i < entries.size(); i++) {
	var cale:NotesCalendarEntry = entries.elementAt(i);
	requestScope.status = requestScope.status + cale.read() + "\n";
	cale.recycle();
}

LotusScript® syntax and examples

NotesCalendar.GetEntries(start As NotesDateTime, end As NotesDateTime, Optional skipcount As Long, Optional maxreturn As Long) As Variant
This agent gets calendar and scheduling information for the current user for today and tomorrow.
Sub Initialize
	Dim session As New NotesSession
	Dim maildb As New NotesDatabase("", "")
	Dim cal As NotesCalendar
	Dim dt1 As NotesDateTime
	Dim dt2 As NotesDateTime
	Dim db As NotesDatabase
	Dim doc As NotesDocument
	Dim body As NotesRichTextItem
	REM Get calendar for current user
	Call maildb.Openmail()
	Set cal = session.getCalendar(maildb) ' Not In ref pane
	Set dt1 = session.createdatetime("Today 08")
	Set dt2 = session.Createdatetime("Tomorrow 17")
	Set db = session.CurrentDatabase
	REM Create document to post results
	Set doc = db.CreateDocument
	doc.Form = "main"
	doc.Subject = "Today and tomorrow"
	Set body = doc.Createrichtextitem("body")
	REM Get entries and put in body of document
	ForAll cale In cal.Getentries(dt1, dt2)
		Call body.Appendtext(cale.Read())
		Call body.Addnewline(1)
	End ForAll
	Call body.Appendtext(cal.ReadRange(dt1, dt2))
	Call doc.Save( True, True )
End Sub

Java syntax and examples

java.util.Vector NotesCalendar.getEntries(DateTime start, DateTime end)
java.util.Vector NotesCalendar.getEntries(DateTime start, DateTime end, int skipcount, int maxreturn)
This agent gets calendar and scheduling information for the current user for today and tomorrow.
import lotus.domino.*;

public class JavaAgent extends AgentBase {

    public void NotesMain() {

      try {
          Session session = getSession();
          AgentContext agentContext = session.getAgentContext();

          // (Your code goes here)
          DbDirectory dbdir = session.getDbDirectory("");
          Database maildb = dbdir.openMailDatabase();
          NotesCalendar cal = session.getCalendar(maildb);
          DateTime dt1 = session.createDateTime("Today 08");
          DateTime dt2 = session.createDateTime("Tomorrow 17");
          // Create document to post results
          Database db = agentContext.getCurrentDatabase();
          Document doc = db.createDocument();
          doc.appendItemValue("Form", "main");
          doc.appendItemValue("subject", "Today and tomorrow");
          RichTextItem body = doc.createRichTextItem("body");
          // Get entries and put in body of document
          java.util.Vector entries = cal.getEntries(dt1, dt2);
          for (int i = 0; i < entries.size(); i++) {
        	  NotesCalendarEntry cale = (NotesCalendarEntry)entries.elementAt(i);
        	  body.appendText(cale.read());
        	  cale.recycle();
        	  body.addNewLine(1);
          }
          doc.save(true, true);

      } catch(Exception e) {
          e.printStackTrace();
       }
   }
}