Page 1 of 1

CashBookTransaction type Debtor

PostPosted: Thu Jun 18, 2015 3:07 pm
by neil.interactit
Hi guys,

Could you provide some guidance adding a "debtor" cashbook transaction ...

Code: Select all
                Dim newKey = 0
                cashBook.AddNewTransaction(payment.TransactionType, "", newKey)
                Dim newCashBookLine As JiwaCashBook.CashBookTransaction = cashBook.CashBookTransactions(newKey)


This snippet is in a loop, working repeatedly while payment.TransactionType = Other {0}, but the 3rd line fails when payment.TransactionType = Debtor {1} ... the newKey (normally a GUID) is 0 in this case ... causing the error "collection index must be 1 to the size of the collection".

Could you advise how to (correctly) create a debtor cashbook transaction? (Could you include how to attach the debtor too)?

Cheers,
Neil

Re: CashBookTransaction type Debtor  Topic is solved

PostPosted: Thu Jun 18, 2015 3:12 pm
by Mike.Sheen
Hi Neil,

What you have is close - you just need to pass the debtorID to the AddNewTransaction method:

Code: Select all
ReturnCode = _CashBook.AddNewTransaction(JiwaCashBook.CashBookTransactionCollection.TransactionTypes.Debtor, DebtorID, newKey)

Re: CashBookTransaction type Debtor

PostPosted: Thu Jun 18, 2015 4:16 pm
by neil.interactit
Sweet! Thanks.