Slices appointments into single entities that are within a single day. This class is essential when having calender data (with entries possibly spanning several days), which you would like to display in the calender control (which only accepts data for single days).
Constructors
AppointmentSlicer()
Default constructor.
Methods
addAppointment(Integer,DateTime,DateTime,String)
Adds an appointment to the class.
Returns: CRMScript.Global.Void
clear()
Clears all the added appointments from the instance.
Returns: CRMScript.Global.Void
eof()
Returns true if the internal iterator is past the appointments for the chosen day; otherwise, false.
Returns: CRMScript.Global.Bool - True if the internal iterator is past the appointments for the chosen day; otherwise, false.
getLoadForDay(Date,Time,Time,Integer)
Returns the accumulated load for a given day.
Returns: CRMScript.Global.Integer - The calculated load for the given day.
The load is calculated by adding all the appointments for that day, cutting them at the start and stop times. Finally, the value returned is never more than max (unless max is -1, in which case there is no limit).The start and stop limits are useful because it can be used to eliminate private appointments in the evening.The max is good, because one normally never works more than 8 hours pr. day :)
getValue(String)
Returns the value for the given field for the appointment pointed to by the internal iterator.
Returns: CRMScript.Global.String - The value for the given field for the appointment pointed to by the internal iterator.
Available fields: id, date, start, stop, stop, title
next()
Moves the internal iterator to next appointment in the same day.
Returns false if <code>eof()</code>; otherwise, true.
Returns: CRMScript.Global.Bool - False if eof(); otherwise, true.
setActiveDate(Date)
Sets the internal iterator to the given date.
Returns: CRMScript.Global.Void