Click or drag to resize

ISaleCancelChanges Method

Undo any changes made since the object was loaded.

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

Return Value

Type: 
If you made changes to the model that you don’t want to be saved to the database, call the CancelChanges method

Implements

IModelBaseCancelChanges
Examples

CancelChanges

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

This will change the text of the current sale. 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 sale model to the database.

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

See Also