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

Account_FindByNumber how does it work in php?

0
$bank = $client-Account_FindByNumber(array(Number = 5820)); doesn't work
$bank = $client-Account_FindByNumber(5820)); doesn't work.

so what do i do?

i am trying to do something as simple as creating a cashbookentry, which is very simple if You use .NET API, but it seems a little complicated in PHP so i hope someone can help me as I don't use .NET anymore.

Here is my sourcecode for it that stops with exception when i get to the above mentioned line...
?php
function economic_connect($agreement) {
$url = 'https//wwwe-conomiccom/secure/api1/EconomicWebserviceasmx?WSDL';
   $client = new SoapClient($url, array(trace = 1, exceptions = 1));   
   $client-ConnectAsAdministrator(array(
      'adminAgreementNo' = secret',
      'clientAgreementNo' = $agreement,
      'adminUserID'        = 'secret',
      'adminUserPassword'        = 'secret'));
   return $client;
}
$client = economic_connect(secret);
$cb = $client-CashBook_FindByName(Auto);
    $bank = $client-Account_FindByNumber(array(Number = 5820));
die();
$fejlkto = $client-Account_FindByNumber(array('Number' = 9900));
$dkk = $client-Currency_FindByCode(array('Code' = 'DKK'));
$client-CashBookEntry_CreateFromData(array('data' =
                array(
                    'Type' = 'FinanceVoucher',
                    'CashBookHandle' = $cb,
                    'AccountHandle' = $bank,
                    'ContraAccountHandle' = $fejlkto,
                    'Text' = utf8_encode('eksempeltekst'),
                    'AmountDefaultCurrency' = '42',
                    'Amount' = '42',
                    'Date' = date('Y-m-d\THis'),
                    'VoucherNumber' = '1234',
                    'CurrencyHandle' = $currencyHandle
                    )
                ));
?
created Jun 12, 2011 by olsen-it
0% Accept Rate
Q 2 A 2 C 0

1 Answer

0
The above has been solved.
I ran into even more trouble though... I will make a new post.
answered Jun 13, 2011 by olsen-it
Visma e-conomic A/S
...