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

DebtorContact_Create not working

0

Hi everyone,

Im having some trouble with the DebtorContact_Create function in soap and php. 

Im trying to run this code in a class in laravel: https://gist.github.com/olebulow/10769678

But i cant get it to work (i have gotten it to work with Debtor_ and Product_ but i simply cant get the above to work which is pretty darn confusing. Looking blind now. 

Can someone cast a shed of light on whats wrong?

Basicly what it SHOULD do is that when i create a contact on a customer in my webapp, it should also create it under the customer in e-conomic.  What to do.

created Apr 15, 2014 by olebulow
50% Accept Rate
Q 2 A 0 C 1

1 Answer

0

You should execute the function like this :

$debtor_contact_handle = $client->DebtorContact_Create(array(
                      'debtorHandle' => array('Number'=>'112'),
                      'name' => "name"
                    ))->DebtorContact_CreateResult;
 
'debtorHandle' is the handle used for creating customer. 
 
Also, if you simply want function to create a customer then use this :
 
$customerdata = array(
'Handle' => array('Number'=>'111'),
'Number' => '111',
'DebtorGroupHandle' => array('Number'=>'1'),
'Name'=> 'name',
'VatZone'=> 'HomeCountry' ,
'CurrencyHandle' => array('Code'=>'INR'),
'PriceGroupHandle' => array('Number'=>1),
'IsAccessible' => 'true',
'Ean'=> '',
'PublicEntryNumber'=> '123456',
'Email' =>'email@email.com',
'TelephoneAndFaxNumber' => '1234567890',
'Website' => 'demo.com',
'Address' => 'address',
'PostalCode'=> '123456',
'City'=> 'city',
'Country'=> 'country',
'VatNumber' => '' ,
'County' => 'county',
'CINumber' => '',
'TermOfPaymentHandle' => array('Id'=>2)
'LayoutHandle' => array('Id'=>3),
'AttentionHandle' => array('Id'=>1),
'YourReferenceHandle' =>array('Id'=>1) 
);
$result = $client->Debtor_CreateFromData(array( "data"=>$customerdata ) );
 
imageimage

 

answered Sep 18, 2014 by Wisdmlabs
edited Sep 18, 2014 by Wisdmlabs
Visma e-conomic A/S
...