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

CashBook may not be null, well it's not

0
Hi im trying to create a CashBookEntry. However i keep getting a validation exception telling me that the Cashbook may not be null. The cashbook i submit are not null though, since i am able to pull and print data from it. What am i doing wrong? All help appreciated, thanks.

David



function confirmPayment1($invoiceNumber, $amount){
        $cb = $this-soapClient-CashBook_FindByNumber(array('number' = 2));
        $cashBookData = $this-soapClient-CashBook_GetData(array('entityHandle' = $cb-CashBook_FindByNumberResult))-CashBook_GetDataResult;
        print($cashBookData-Number);
        print($cashBookData-Name);
          $bank = $this-soapClient-Account_FindByNumber(array('number' = 5820))-Account_FindByNumberResult;
          $fejlkto = $this-soapClient-Account_FindByNumber(array('number' = 9900))-Account_FindByNumberResult;
          $invoice = $this-soapClient-Invoice_FindByNumber(array('number' = $invoiceNumber))-Invoice_FindByNumberResult;
          $debtor = $invoice-Debtor;
           $this-soapClient-CashBookEntry_Create(array(
                    'type' = 'DebtorPayment',
                    
                    'cashBook' = $cashBookData-Handle,
                       'debtor' = $debtor,
                    'contraAccount' = $bank,
                    'debtorInvoiceNumber' = $invoiceNumber,
                    'date'= date(Y-m-d)T000000,
                    'amountDefaultCurrency'=10,
                    'amount' = $amount,
                    'currency' = 'DKK',
                    'text' ='Indbet fak '$invoiceNumber
                    
                    
                    

                    ));
    }
created Jun 24, 2011 by Davidmu
0% Accept Rate
Q 1 A 2 C 0

4 Answers

0
Hi,

My gut reaction would be that this stems from you supplying a CashBookData handle to CashBookEntry_Create() - instead of a CashBook handle, which is what it takes.


Regards,
answered Jun 27, 2011 by Christian Estrup
0
Thank you for responding Christian, however if you look at the code you will see that i did supply the CashBookEntry_Create() with CashBookData handle. The cashBookData handle is not null since it can print data.
answered Jun 27, 2011 by Davidmu
0
Hi,

What I mentioned was that CashBookEntry_Create() should NOT be provided with a CashBookData handle - but rather with a CashBook handle.

As per here - https//wwwe-conomiccom/secure/api1/EconomicWebServiceasmx?op=CashBookEntry_Create.


Best regards,
answered Jun 27, 2011 by Christian Estrup
0
Hi,
Thank you i had tried both before, however you link let me to the right answer.
The name should be 'cashBookHandle' instead of 'cashBook'. Thanks for the help.
answered Jun 27, 2011 by Davidmu
Visma e-conomic A/S
...