VB6 Customer Account

From Sage Evolution SDK | Documentation Portal
Revision as of 12:10, 26 October 2015 by Admin (Talk | contribs) (Created page with "<syntaxhighlight lang="vb"> Dim helper As ComHelper Set helper = New ComHelper On Error GoTo ErrHandler 'Initialisation helper.CreateCommonDBConnection "server=.;initial cata...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Dim helper As ComHelper
Set helper = New ComHelper
On Error GoTo ErrHandler
 
'Initialisation
helper.CreateCommonDBConnection "server=.;initial catalog=EvolutionCommon;integrated security=sspi"
helper.SetLicense "DEMO", "17411087337875"
helper.CreateConnection "server=.;initial catalog=50010;integrated security=sspi"
 
helper.BeginTran
 
'Create a new customer account
Dim cust As Customer
Set cust = New Customer
cust.code = "ABD001"
cust.Description = "ABD"
cust.Save
 
'Post a customer transaction
Dim tran As CustomerTransaction
Set tran = New CustomerTransaction
Set tran.Customer = cust
tran.Date = Now
 
Dim trcode As TransactionCode
Set trcode = helper.GetTransactionCode(Pastel_Evolution_Module_AR, "IN")
tran.TransactionCode = trcode
tran.Amount = 114
tran.Tax = 14
tran.Reference = "INV0001"
tran.Description = "Monthly Fee"
tran.Post
 
helper.CommitTran
Exit Sub
ErrHandler:
    helper.RollbackTran
    MsgBox Err.Description