I am attempting to use the API to create a high number of cashbook entries, and received an e-mail about using many calls to the API.
Therefore I would like to optimize the code to do the least amount of calls when creating an entry, but I cannot find any examples, and the documentation appears to be an extract of methods, without any examples.
This is my code to create a cashbook entry:
Dim objAccount As IAccount
Dim objContraAccount As IAccount
objAccount = objSession.Account.FindByNumber(1010)
objContraAccount = objSession.Account.FindByNumber(6820)
Dim objEntry As ICashBookEntry
objEntry = objSession.CashBookEntry.CreateFinanceVoucher(objCashBook, objAccount, objContraAccount)
objEntry.Currency = objSession.Currency.FindByCode(EUR)
objEntry.VatAccount = objSession.VatAccount.FindByVatCode(U25)
objEntry.VoucherNumber = 5000
objEntry.Amount = -100
objEntry.AmountDefaultCurrency = -745
objEntry.Date = New Date(2011, 5, 23)
objEntry.Text = Ordre Nummer
Dim objData As ICashBookEntryData
objData = objSession.CashBookEntryData.GetData(objEntry)
From what I could gather from the e-mail, each time I do a objEntry., it gives an API call.
How can I create a new entry with these data's without calling the API too many times?