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

Problem updating debtor from data

0
When I try to update a Debtor from data, i get "An internal error has occurred. (id=3e273565-4bb1-4a16-ac4c-6fd04223c3b2)". What does that mean?
 
In a few more details, here is the Java code I use:
 
List<DebtorHandle> debtorHandles = session.debtorFindByCINumber(reference).getDebtorHandle();
DebtorHandle debtorHandle = debtorHandles.isEmpty() ? null : debtorHandles.get(0);
 
DebtorData debtorData = new DebtorData();
debtorData.setCINumber((String) data.get(EconomicData.USER_REF));
debtorData.setEmail((String) data.get(EconomicData.EMAIL_ADDRESS));
debtorData.setName((String) data.get(EconomicData.NAME));
debtorData.setAddress((String) data.get(EconomicData.ADDRESS));
debtorData.setPostalCode((String) data.get(EconomicData.ZIP));
debtorData.setCity((String) data.get(EconomicData.CITY));
debtorData.setCounty((String) data.get(EconomicData.REGION));
debtorData.setCountry((String) data.get(EconomicData.COUNTRY));
 
debtorData.setDebtorGroupHandle((DebtorGroupHandle) data.get(EconomicData.DEBTOR_GROUP));
debtorData.setTermOfPaymentHandle((TermOfPaymentHandle) data.get(EconomicData.TERMS_OF_PAYMENT));
debtorData.setIsAccessible(true);
debtorData.setVatZone(determineVatZone((String) data.get(EconomicData.COUNTRY)));
debtorData.setCurrencyHandle((CurrencyHandle) data.get(EconomicData.CURRENCY));
 
if (debtorHandle == null) {
  debtorHandle = session.debtorCreateFromData(debtorData);
} else {
  debtorData.setNumber(debtorHandle.getNumber());
  debtorHandle = session.debtorUpdateFromData(debtorData);
}
And here is the stacktrace I get:
 
Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: Economic.Api.Exceptions.ServerException(E00000): An internal error has occurred. (id=3e273565-4bb1-4a16-ac4c-6fd04223c3b2)
at com.sun.xml.internal.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:178)
at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:117)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:108)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:78)
at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:135)
at com.sun.proxy.$Proxy27.debtorUpdateFromData(Unknown Source)
at app.server.helper.impl.EconomicHelperImpl.createDebtor(EconomicHelperImpl.java:209)
at app.server.helper.impl.EconomicHelperImpl.updateEconomic(EconomicHelperImpl.java:96)
at app.server.helper.impl.EconomicHelperImpl.main(EconomicHelperImpl.java:79)
 
It works fine when the customer does not exist and it chooses the path to create from data instead of updating.
 
Bests,
Morten

 

created Oct 7, 2014 by morols
67% Accept Rate
Q 3 A 0 C 2

1 Answer

0
 
Best answer
Hi Morten,

Please check the following:

1) The debtor you are trying to update actually exist (id=157)

2) The debtor group you are trying to assign actually exist (id=2)

3) The term of payment you are trying to assign actually exist (id=7)

/Morten
answered Oct 15, 2014 by mortenanders
selected Oct 15, 2014 by morols
Thanks, it turned out that I didn't set the handle before updating (i.e. debtorData.setHandle(debtorHandle)) - at least adding it solved the problem.

Network

Find all the documentation and resources you need to build great apps.
Go to Developer site

Newsletter

Get the latest news and important info from the e-conomic developer world.
Sign up now

Visma e-conomic A/S
...