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 Attention Name from a Debtor


I´m trying to list my Debtors - which I can do without problems;

// Fetch list of all debtors
                    $debtorHandles = $client-Debtor_GetAll()-Debtor_GetAllResult-DebtorHandle;
                    $debtorDataObjects =$client-Debtor_GetDataArray(array('entityHandles' = $debtorHandles))-Debtor_GetDataArrayResult-DebtorData;
                            foreach ($debtorDataObjects as $i = $debtorData) {
                            $ekundeNr = $debtorData-Number;
                            $ekundeNavn = utf8_decode($debtorData-Name);
                            $ekundeAdresse = utf8_decode($debtorData-Address);
                            $ekundePost = utf8_decode($debtorData-PostalCode);
                            $ekundeBy = utf8_decode($debtorData-City);
                            $ekundeEan = $debtorData-Ean;
                            $ekundeAtt = $debtorData-AttentionHandle-Id;

Then I get the ID (eg. 268) from then AttentionHande ($ekundeAtt).

Now I would like to know the NAME of Attention with ID (eg. 268).



Also, I would like to get the NAMES of all the Attentions related to a customer number...

I have no idea how to...

BR Thauser
created Nov 24, 2011 by thauser
0% Accept Rate
Q 3 A 7 C 0

3 Answers

Hi thauser,

Attentions are DebtorContact entities, so if you use the handle to look up the relevant DebtorContact, you should be able to pick up the name.

Best regards,
answered Nov 26, 2011 by Christian Estrup
Hi Christian,

Got it - but it boosts the runtime from 5s to 70s...

Think I will have to live with that.

BR Thauser
answered Nov 26, 2011 by thauser
Hi Thauser,

You can optimize that greatly by pulling all DebtorContacts via .GetAll(), followed by .GetDataArray(), and then do a lookup on that.

- pretty much the same as described in this (admittedly .NET) example: http//techtalke-conomiccom/improving-api-performance-beyond-data-classes/.

Best regards,
answered Nov 29, 2011 by Christian Estrup
cant you DebtorContact_GetAll _from_debtor
and get all Contqacts from a debtor handle??
Visma e-conomic A/S