This function saves the appointment.
object.Save2(aCheckDuplicates, aErrorMsg)
Part | Attribute | Type | Description |
---|---|---|---|
object |
Required | The object always implements the
ISAppointment interface |
|
aCheckDuplicates |
In, Required | bool |
Checks duplicated appointments |
aErrorMsg |
Out, Required | object& |
Returns a list of errors if the appointment was not
saved, otherwise, returns an empty string |
bool
Display "True" if the appointment was saved successfully.
Dim aPatient
Dim aProvider
Dim aFilter
Dim aAppointments
Dim aFirstAppointment
Dim aNewAppointment
Dim aCheckDuplicates
Dim aResult
Dim aErrorMsg
set aPatient = Profile.SelectPatient
set aProvider = Profile.LoadProvider("PROV")
set aFilter = Profile.CreateAppointmentFilter
aFilter.ProviderID = aProvider.Id
aFilter.PatientId = aPatient.Id
aFilter.DateFrom = #01/01/2018#
aFilter.DateTo = #01/01/2019#
set aAppointments = Profile.LoadAppointments(aFilter)
if aAppointments.Count > 0 then
set aFirstAppointment = aAppointments.Item(0)
set aNewAppointment = Profile.CreateAppointment
aNewAppointment.ProviderId = aFirstAppointment.ProviderId
aNewAppointment.BookTime = aFirstAppointment.BookTime
aNewAppointment.Duration = aFirstAppointment.Duration
aNewAppointment.PatientId = aFirstAppointment.PatientId
aCheckDuplicates = true
aResult = aNewAppointment.Save2(aCheckDuplicates, aErrorMsg)
if aResult then
Profile.MsgBox("The appointment was saved successfully")
else
Profile.MsgBox("The appointment was not saved successfully. " & aErrorMsg)
end if
else
Profile.MsgBox("aAppointments.Count = 0")
end if
In Profile Client v8 on User Interface Save2 cannot be found.