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

Updating debtor, DebtorGroup cannot be null ?

$DebtorGroupHandle = array('Number' = 1); // I only have one debtor group which is number 1
$debtorHandle = $client-Debtor_FindByNumber(array('number' = 27362567))-Debtor_FindByNumberResult;
$debtorData = $client-Debtor_GetData(array('entityHandle' = $debtorHandle))-Debtor_GetDataResult;

$debtor_update = $client-Debtor_UpdateFromData(array(
  'data' = (object) array(
  'Handle' = $debtorHandle,
  'Email' = 'test@test.com',
  'VatZone' = 'HomeCountry',
  'IsAccessible' = true,
  'debtorGroupHandle' = $DebtorGroupHandle

27362567 is a number of a debtor, and i wish to update their email address. But I am receiving the error:
Economic.Api.Exceptions.ValidationException(E04010): DebtorGroup cannot be null.

I dont know why it gives me this error, debtorGroupHandle is defined and creating a debtor works without problems
created Mar 30, 2012 by azddin
0% Accept Rate
Q 3 A 2 C 0

1 Answer

Fixed this by changing $DebtorGroupHandle to:

$DebtorGroupHandle = $client-debtorGroup_GetAll()-DebtorGroup_GetAllResult-DebtorGroupHandle;
answered Apr 1, 2012 by azddin
Visma e-conomic A/S