Difference between revisions of "VB6 Customer Account"

From Sage Evolution SDK | Documentation Portal
Jump to: navigation, search
(Created page with "<syntaxhighlight lang="vb"> Dim helper As ComHelper Set helper = New ComHelper On Error GoTo ErrHandler 'Initialisation helper.CreateCommonDBConnection "server=.;initial cata...")
 
(No difference)

Latest revision as of 12:10, 26 October 2015

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