Click or drag to resize

IDatabaseCreateSale Method

Create a blank Sale object. Returns an error if you are not allowed to create sales. Use SetDefaults on the sale object to fill it with sensible data

Namespace:  SuperOffice.COM.SuperOfficeDB
Assembly:  SuperOfficeDB.Interop (in SuperOfficeDB.Interop.dll) Version: 8.0.0.0
Syntax
SOSale CreateSale()

Return Value

Type: SOSale
SOSale – the newly created Sale object
Examples

Create a new sale

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

VB
Dim objDB
Dim objSale
Set objDB = CreateObject("superofficedb.database")
If Not (objDB is Nothing) Then
    objDB.login "<userid>", "<password>" ' log in to the database
    Set objSale = objDB.CreateSale
    objSale.setdefaults
    objSale.amount = 30000
    ' Get the contact with the ID 3
    objSale.contact = objDB.GetContact(3)
    objSale.saletext = "instrumentation of the new cessna 172"
    objSale.Save
Else
    MsgBox "Unable to connect to database"
End If
Set objDB = Nothing

See Also