API Forum

This forum is in read-only mode.
Please refer to our API support in case you have any questions.
We can be reached at api@e-conomic.com
e-conomic API developer forum

get Debtor from a cashBookEntry

Hey Support ,

I am trying to get all cachebookentries of a debtor. My goal is to fetch all data presented in  the 'ledger card'.

The only way to make this work, according to the diagram of the e-conomic api 1.4.5 is to fetch all CashBookEntries, then fetch the related accounts, considering the exist(if it is a financial transaction) and then get the Account.

Even though I can get the accounts, when trying Debtor_FindByNameResult no query returns a debtor!

Any advice on achieving the above?

A last note, the approach describe above is quite unorthodox. I am fetching every entry, for every entry I fetch the account and then I try to get the debtor.

It would make much more sense to get all CacheBookEntries of an debtor directly.

Please provide some info on how to achieve at least 1 of the 2!


created Nov 15, 2013 by gc
0% Accept Rate

edited Nov 18, 2013 by gc
Q 6 A 1 C 5

1 Answer

Hi gc,


Why do you specifically need cash book entries - i.e., not-yet-booked entries?

A debtor/customer ledger card typically contains booked entries only. These can be retrieved via the Debtor object's GetEntries() for all entries, or GetOpenEntries() for open entries only.


Best regards,
answered Nov 18, 2013 by Christian Estrup
One last thing concerns the Saldo field in the entries. Is there a way to fetch this for every entry or should I just calculate it?
What entity's Balance field do you mean?
I am talking about the debtor's entries.
Debtor entries don't have a balance.

However, the debtor itself does - by defininition, that's the total of the debtor's entries' AmountDefaultCurrency.
So that balance field presented in the ledger card is calculated according to the transaction history, it's not fetched by any entities.
What do you mean by "not fetched by any entities".

Again, a debtor's balance, by definition, is the total of the entries on the debtor. Just like the balance on a creditor/supplier is the total of the balance of the creditor/supplier. And same for finance accounts.
Yes but on an actual ledger card you can see the field saldo.  This represents the debtors balance after the specific transaction has been made and not the current debtor's balance which is the one you are talking about.
Ah :-)

That's just a running total - including each line's amount, as well as any preceding ones, BASED ON THE SELECTED SORT ORDER !

As such, it's not necessarily the balance "after the specific transaction has been made".

Also, seeing as what's shown here depends on the sort order, it's calculated 'live' and not stored anyway. So, if you wish to display something similar to a user in a ledger card, you need to generate it on-the-fly yourself.
110% clear answer, thanks!
Hi GC,

The Customer balance (saldo) is available on the Debtor.
See method:
Read the property "Balance".

Br Morten Schmidt, API-Support
(Sorry, I was not aware of your discussion here. It happened while I had done my last refresh of the page.)
Visma e-conomic A/S