ISAppointment.GetNextOccurenceDate

Description

This function returns the date and time of the next occurrence of the recurring appointment.

Syntax

object.GetNextOccurenceDate(aDateTime)

Part Attribute Type Description
object Required
The object always implements the ISAppointment interface
aDateTime In, Required
DateTime

Return Value

DateTime

Returns the date and time of the next occurrence of the recurring appointment.

Example

Display the date and time of the next occurrence of the recurring appointment.

Dim aPatient
Dim aProvider
Dim aFilter 
Dim aAppointments
Dim aFirstAppointment
Dim aNextAppDate
Dim aAppTemplate

Set aPatient = Profile.SelectPatient
set aProvider = Profile.LoadProvider("MM")
set aFilter = Profile.CreateAppointmentFilter

aFilter.ProviderID = aProvider.Id
aFilter.PatientId = aPatient.Id
aFilter.DateFrom = #01/01/2018#
aFilter.DateTo = #01/01/2019#
aFilter.IncludeRecurrent = 1
set aAppointments = Profile.LoadAppointments(aFilter)

if aAppointments.Count > 0 then
  set aFirstAppointment = aAppointments.Item(0)
  set aAppTemplate = aFirstAppointment.GetRecurrenceTemplateForOccurence  
  aNextAppDate = aAppTemplate.GetNextOccurenceDate(aFirstAppointment.BookedTime)
  Profile.MsgBox(aNextAppDate)  
 
else
  Profile.MsgBox("aAppointments.Count = 0")
end if  
Note:

In Profile Client v8 on User Interface Next Occurrence Date can be found in Appointment Window > Booking.

Version information

Added in v7.8.0