invantive documentationpart of invantive cloud
Invantive Support ForumsLog In / Sign Up

Retrieving packing slip PDF from Exact Online

Replies happen on the forum.

Go to source

Question

We want to retrieve the packing slip PDFs generated by Exact Online for sales orders via Invantive. Are we accessing the correct tables/endpoints for this?

We use the UniversalSQL editor in Invantive Online. The ultimate goal is to store the PDFs for sales orders with DeliveryStatus = 21 in a separate SQL Server table and then export them to our WMS. We keep a local record of which files have been retrieved and processed.

Situation

In Exact Online we can open the associated packing slip and PDF via a goods delivery. This refers to the generated packing slip, not a manually added order attachment.

We can derive the document ID and the attachment ID from the browser links. We use the same Exact user in Exact Online and Invantive.

The administration code and GUIDs in the examples below are fictitious.

What we have tested

These tables do not return any rows:

  • ExactOnlineREST.Documents.Documents
  • ExactOnlineREST.Documents.DocumentsBulk
  • ExactOnlineREST.Documents.DocumentAttachments
  • ExactOnlineREST.Documents.DocumentAttachmentsBulk
  • DocumentAttachmentFilesIncremental

Even a targeted search using the known attachment ID yields no results:

use 1234567@eol;

select ID
,      Document
,      FileName
,      Url
from   ExactOnlineREST.Documents.DocumentAttachments@eol
where  ID = to_guid('11111111-2222-3333-4444-555555555555');

For data previously retrieved from GoodsDeliveries, the fields Document and DocumentSubject are empty.

This does work, however

Using the known download link, we can successfully retrieve the binary PDF content:

use 1234567@eol;

select DocumentContents as PdfContent
from   ExactOnlineHTML.Documents.AttachmentByUrl@eol
(
    'https://start.exactonline.nl/docs/SysAttachment.aspx?Download=1&ID=11111111-2222-3333-4444-555555555555&_Division_=1234567'
);

Downloading a known attachment therefore works. What is still missing is the ability to automatically identify the correct document/attachment ID for a goods delivery or packing slip.

Our questions

  • Via which table or endpoint do we find the packing slip PDF generated by Exact for a goods delivery?
  • Should this PDF be visible in Documents and DocumentAttachments, or do generated packing slips follow a different path?
  • How do we establish the link from sales order → goods delivery/packing slip → document → attachment?
  • Could permissions or application scopes explain why the document tables remain empty, whilst the same user is able to download the PDF via AttachmentByUrl?
  • Which tables would you recommend for periodic synchronisation of these packing slips?

Accepted answer

The route via the Document* tables should work.

Advice is to check the rights of the Exact Online user used within Exact Online to request this information.

In SessionIOs@DataDictionary you can possibly check whether an HTTP 403 occurs; it signals within "no rows" whether there is an authorization problem.

Reply 3

Dat werkt inderdaad. De rechten waren het probleem.

Reply 4

Nieuwe vraag afgesplitst naar: Printen pakbon via Invantive

Reply on the forum