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_CreateFromData does not use the passed Number

0
If I do not pass a Number on a Debtor Contact, I will get an error that sounds something like:

Economic.Api.Exceptions.SchemaException(E00500): The element 'data' in namespace 'http://e-conomic.com' has invalid child element 'IsToReceiveEmailCopyOfOrder' in namespace 'http://e-conomic.com'. List of possible elements expected: 'Number' er' in namespace 'http://e-conomic.com'. (id=050721d6-0222-4c6b-bdc4-2f7cf08ba295)

If I fix it, passing the Number property (as an integer of course), the contact will be created, and an ID will be returned. But then, if i fetches the newly created contact, the number on that contact will just be last-contact-created-number + 1.

The same problems goes for passing a Handle with an ID. The ID will be ignored, and the API will just assign whatever ID to the contact.

Any help will be appriciated!
created Dec 15, 2015 by mathiasjakobsen
33% Accept Rate

reopened Dec 16, 2015 by mathiasjakobsen
Q 3 A 0 C 3

1 Answer

0
Hi Mathias

DebtorContacts are (as you've noted) numbered sequentially and cannot be numbered manually.

Please send '0' (or any integer for that matter).

The response will include the id of your newly created DebtorContact as it is used for DebtorContact_GetData / DebtorContact_GetDataArray

Number isn't relevant as there are only DebtorContact_FindByExternalId, DebtorContact_FindByName methods for locating the handle.

Furthermore identifying numbers in SOAP aren't necessarily reflected in GUI. E.g. how a CurrentInvoice id has no reference to the "number" columnt shown in GUI.
answered Dec 16, 2015 by olej
Thank you for the clarification! It was very helpful.
Does the same goes for passing an ID. My problem is, that if i need to create i.e. 100 contacts via the API, I get this error "The entity cannot be created because the key already" if the API requests is called after each other, too fast. I solved it when creating Debtors, by passing a custom "Number". Is there a solution, so I can create DebtorContacts without manually adding delay?
Visma e-conomic A/S
...