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

Ordeline.GetByProduct(IProduct) throwns Internal Error


FindByProduct works fine with InvoiceLine but throws:
An internal error has occurred. (id=8f285f56-9738-401d-8d6c-ad2625ef7265)
When used with OrderLine

This increases query time from 0.2 sec to 2min+ since I have to getall->getalldata->loop through->request productId->compare

            var product = session.ProductData.GetData(session.Product.FindByNumber("foo"));
            var pi = session.OrderLine.GetAll();
            var pd = session.OrderLineData.GetDataArray(pi);
            foreach (var productData in pd)
                if (productData.Product != null && productData.Product.Number == product.Number)

This also requires individual calls to the API since there is no way to compare interface objects without requesting the id (even though the interface object already has this information, it is requested again when accessed for some reason).

For customers with 10k+ orderlines this becomes really silly.

created Nov 6, 2014 by Teyken
50% Accept Rate
Q 4 A 3 C 3

1 Answer

Best answer
Just found that .Equals() does allow interface object comparison without requesting value from API

Still need to get all the data - but this helps a lot!
answered Nov 6, 2014 by Teyken
Visma e-conomic A/S