Importing debtors via webservice

Forum for .PHP developers using the E-conomic API.
Exchange your ideas, tip and tricks using the API.
Best Practices

Importing debtors via webservice

Postby emilh » Sun Oct 23, 2011 1:44 pm

Hello everyone :-)

I am importing debtors to a Wordpress-installation using the webservice. It works great!

We have run in to a small problem however. We can't seem to get the value of the "Deres ref." (Your reference) field from each debtor. It looks like the webservice only returns some kind of ID - but the client has some information in a string stored in this field, that we need to have access to. How would You do that?

I use this function from the documentation: https://www.economic.com/secure/api1/EconomicWebservice.asmx?op=Debtor_GetYourReference

But i have also tried to get all data with the GetData function.

Any help or enlightenment is greatly appriciated :-)!
-
emilh
 
Posts: 1
Joined: Sun Oct 23, 2011 1:34 pm

Re: Importing debtors via webservice

Postby Christian Estrup » Mon Oct 24, 2011 2:29 pm

Hi,

As per the YourReference property description:

http://www.e-conomic.com/apidocs/Documentation/P_Economic_Api_IDebtor_YourReference.html

- This is a reference to a DebitorContact.

To retrieve e.g. the name, you can do something like this:

IDebtorContact contact = objDebtor.YourReference;
string name = (contact == null ? "" : contact.Name);


Best regards,
Christian Estrup
Chief Architect

Image
Online accounting
User avatar
Christian Estrup
 
Posts: 245
Joined: Tue Jun 09, 2009 6:37 pm


Return to PHP



cron