Click or drag to resize

IAppointmentChangeIdentity Method

Loads a different record into the object. Causes changes to the existing object to be saved first. Saves the changes made to the appointment model to the database. The last thing you do to an object if you want the changes you made to be saved. The ChangeIdentity method calls the save method first.

Namespace:  SuperOffice.COM.SuperOfficeDB
Assembly:  SuperOfficeDB.Interop (in SuperOfficeDB.Interop.dll) Version: 8.0.0.0
Syntax
void ChangeIdentity(
	int NewIdentity
)

Parameters

NewIdentity
Type: SystemInt32
as appointment_id (long), the internal identity in the database

Implements

IModelBaseChangeIdentity(Int32)
Examples

ChangeIdentity

This text may be copied to the notepad, and saved as a *.vbs file. Remember to change the login information.

This will change the description text of the current appointment. If you dont want to save the changes, NO calls the CancelChanges method. If you want to save the changes, YES calls the ChangeIdentity() that saves the appointment model to the database.

VB
Dim objSO
Dim result
Dim id
Set objSO = CreateObject("SuperOffice.Application")
If not (objSO is nothing) Then
    id = objSO.CurrentAppointment.Identity
    objSO.CurrentAppointment.Description = "This text been changed"
    result = MsgBox ("The text of the current appointment has been changed, do you want to save these changes?", vbInformation + vbYesNo, "SuperCOM")
    if result = vbYes then
        objSO.CurrentAppointment.ChangeIdentity(id)
    else
        objSO.CurrentAppointment.CancelChanges()
        msgbox "The appointment changes was not saved", vbInformation + vbOkOnly, "SuperCOM"
    end if
else
    MsgBox "Unable to connect to database"
end if
Set objSO = Nothing

See Also