ISAppointment.DeleteRegistryKey

Description

This function deletes the selected registry key of the appointment.

Syntax

object.DeleteRegistryKey aRegistryKey

Part Attribute Type Description
object Required
The object always implements the ISAppointment interface
aRegistryKey In, Required
The registry key to delete

Example

Delete the selected registry key of the appointment.

Dim aPatient
Dim aProvider
Dim aFilter 
Dim aAppointments
Dim aFirstAppointment
Dim aRegKey
Dim aAllKeys
Dim aRegKeyShortCode

aRegKeyShortCode = "APRK1"
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/2019#
aFilter.DateTo = #01/01/2020#

set aAppointments = Profile.LoadAppointments(aFilter)

if aAppointments.Count > 0 then
  set aFirstAppointment = aAppointments.Item(0)
  set aRegKey = aFirstAppointment.AddRegistryKey(aRegKeyShortCode, "NiceValue") 
  aFirstAppointment.Save

  set aAllKeys = aFirstAppointment.GetRegistryKeys
  Profile.MsgBox(aAllKeys.Count)
  
  set aRegKey = aAllKeys.Item(0) 
  aFirstAppointment.DeleteRegistryKey(aRegKey)

  set aAllKeys = aFirstAppointment.GetRegistryKeys
  Profile.MsgBox(aAllKeys.Count) 
else
  Profile.MsgBox("aAppointments.Count = 0")
end if  
Note:

In Profile Client v8 on User Interface Registry Key cannot be found and deleted.

See also

Version information

Added in v8.2.0