Please enable JavaScript to view this site.

Invantive Notes

Navigation: English > LinkedIn

Report Exact Online Support Questions

Scroll Comments Prev Top Next More

Using Invantive SQL you can easily upload and download information from cloud platforms such as Exact Online. The peculiarities of the APIs are hidden behind an advanced SQL engine. However, when something works differently than you would expect, the cloud platform support channels typically require you to provide API calls instead of Invantive SQL statements to analyze and reproduce an issue.

This note describes how you can collect analytical information for Exact Online. The use case was that upon creation of a sales order from EDI messages from Descartes, the customer's price list was only applied to the first order line instead on all lines. In this use case, a large number of XML files in INH3 (Inhouse 3) format of Descartes containing INVOIC messages are transformed into Exact Online sales orders.

Materialize Data

The processing of EDI messages is non-trivial and involves many steps and tables. It is convenient to materialize the data used to create the sales orders to simplify reproduction so you don't have to set up the EDI environment on every test.

The sales orders and order lines are created using an Invantive SQL transaction using two queries joining approximately ten tables. As a first step we materialize the data into XML dump files for easy replay:

select ...


local memorize results clipboard hdr


local save results clipboard hdr to "c:\temp\sample-trace-insert-order-headers.xml" format xml

We materialize both the sales order headers and sales order lines to two separate files. The resulting XML files can later easily be loaded into memory as shown in the next step. The XML files contain both metadata and payload.

Exact Online API Native Calls

Using these XML dumps, you can reproduce the Invantive SQL transaction using the script below. The essential part is setting the provider attribute trace-native-calls to true. It print all native calls to the trace log. The trace log can be inspected using Microsoft Debugview or by activating the trace to file features as described in the manual. Trace-native-calls works for cloud platforms such as OData and XML, but also for traditional native database calls such as on Teradata and SQL Server.

set trace-native-calls true


local load results clipboard lne from "c:\temp\sample-trace-insert-order-headers.xml" format xml


local insert results clipboard lne in table hdr@inmemorystorage create


local load results clipboard lne from "c:\temp\sample-trace-insert-order-lines.xml" format xml


local insert results clipboard lne in table lne@inmemorystorage create


begin transaction


insert into exactonlinerest..salesorders@eol

( description

, orderedby

, deliverto

, deliveryaddress

, invoiceto

, warehouseid

, yourref

, orderdate

, deliverydate

, salesperson

, remarks


select description

,      orderedby

,      deliverto

,      deliveryaddress

,      invoiceto

,      warehouseid

,      yourref

,      orderdate

,      deliverydate

,      salesperson

,      remarks

from   hdr@inmemorystorage


by     sales_order_id


insert into exactonlinerest..salesorderlines@eol

( description

, item

, quantity

, unitcode


select description

,      itm_id

,      mle_ordqua

,      unitcode

from   lne@inmemorystorage


to     sales_order_id



Resulting API Call Log

The resulting log looks like this (anonymized) and is ready for delivery to Exact Online support. Please remember to include the associated log on code when you report the call to Exact:

09:52:28.886-25: Native request body on POST to '':

09:52:28.887-25: {



 "Description":"EDI order 123123132 van 23-02-2018",



 "Remarks":"23-02-2018\r\nEnvid: 423423152\r\nAfzender: 8123123123123\r\nReverse: \r\nOntvanger: 8234342423432\r\nBestand: c:\\temp\\in\\Orders_4234234324324.xml",








     "Description":"Trekperen doos",





     "Description":"Reserve Trekpeer",









09:52:28.889-25: New result URL:

09:52:29.580-25: Native response body on POST to '':

09:52:29.581-25: {























   "DeliverToName":"Shop in shop",





   "Description":"EDI order 123123132 van 23-02-2018",











   "InvoiceToName":"p/a Shops",







   "OrderedByContactPersonFullName":"John Doe",

   "OrderedByName":"p/a Shops",






   "Remarks":"23-02-2018\r\nEnvid: 423423152\r\nAfzender: 8123123123123\r\nReverse: \r\nOntvanger: 8234342423432\r\nBestand: c:\\temp\\in\\Orders_4234234324324.xml",












   "WarehouseDescription":"Magazijn Centraal",