Hi. This is a good example.
But now I need to save a collection of journal entries inside a transaction.
Post by GTSageDevNot a good idea to write directly to the database - you'd need to update
many tables as well as perform all validation.
There doesn't seem to be an Excel import routine for GL journals,
otherwise I'd suggest transferring the data via Excel.
So I'd suggest using the API. This is a very basic example of posting a
'sbi is already set up as ISmallBusinessInstance
Dim oJournalEntry As IJournalEntry = sbi.CreateJournalEntry
Dim oFinancialAccounts As IFinancialAccountView = sbi.FinancialAccounts
Dim oJournalLine As IJournalEntryLine
oJournalEntry.FinancialDateTime = Today 'default
oJournalEntry.ReferenceNumber = "DEPREC"
oJournalLine =
oJournalEntry.CreateJournalEntryLine(DocumentLineType.JournalLine)
oJournalLine.Account = oFinancialAccounts.GetByDisplayNumber("1475")
'Office Equip depreciation
oJournalLine.Credit = 100.0
oJournalLine =
oJournalEntry.CreateJournalEntryLine(DocumentLineType.JournalLine)
oJournalLine.Account = oFinancialAccounts.GetByDisplayNumber("1420") 'Office Equip
oJournalLine.Debit = 100.0
oJournalEntry.Save()
PS. I hope this displays ok.