#Description: Example code to add a Transaction Batch.
#Author: Intersoft Systems Limited
#Version: 1.01
#Last Updated: 18/05/2017

  Dim Batch As finBatch
  Dim BatchTransaction As finBatchTransaction
  Dim Success As Boolean

  '====================================
  ' Create Transaction Batch
  Batch = finBL.CreateBatch()

  With Batch
    ' Set Transaction Type
    ' Note, it is best to set Transaction Type if all Transactions use the same Element
    .TransactionTypeId = ""

    ' Set Source
    Success = .SourceSet(isefinTransactionSource.ExternalA)
  End With

  '====================================
  ' Create and add Transaction to Batch
  If Success Then
    BatchTransaction = Batch.Transactions.CreateBatchTransaction()

    ' Update properties
    With BatchTransaction
      ' Set Account
      If Success Then
        ' If you have the Account's Pk this is more efficient
        '.AccountPk = 0
        Success = .AccountIdSet("")
      End If

      ' Set Element
      If Success Then
        ' Only use if different from the Transaction Type
        ' If you have the Element's Pk this is more efficient
        '.ElementPk = 0
        'Success = .ElementIdSet(elementId)
      End If

      If Success Then
        .Date = finBL.TimeZoneFunctions.GetCurrentDatabaseDate()
        .Reference = ""
        .Value = 0
        .Notes = ""
      End If
    End With

    ' Add the Transaction to the Batch
    If Success Then
      Success = Batch.Transactions.Add(BatchTransaction)
    End If
  End If

  '====================================
  ' Commit Batch
  If Success Then
    Success = Batch.ExecuteCommit()
  End If
