Posted sales invoices are dispatched automatically via Pingen whenever codeunit PingenJobQueueVTO runs from a Job Queue Entry.
Which invoices qualify
An invoice is picked up by automatic dispatch when all of the following are true:
-
It is not yet marked as processed (Processed =
No). -
It was posted with the Pingen profile active — i.e. the bill-to customer had the configured Document Sending Profile at the moment of posting. That status is frozen into the internal Pingen Auto-Send flag at posting time and is immutable afterwards.
-
The posting date is at least Send Days Delay days in the past.
|
Condition |
Value |
|---|---|
|
Processed |
|
|
Pingen Auto-Send (frozen at posting) |
|
|
Posting date |
<= today − Send Days Delay |
Important: Profile changes on the customer card do not affect already-posted invoices. To force or prevent dispatch of a posted document after the fact, use the Disable Pingen Sending / Enable Pingen Sending actions (see Enable and Disable Pingen Sending) or the Send via Pingen button for a one-off manual send.
What happens during a run
-
The codeunit verifies that Client ID, Client Secret, Organisation ID, and the profile code are all set. If anything is missing, the run exits cleanly.
-
It iterates over every posted sales invoice with Processed =
Noand Pingen Auto-Send =Yes. -
For each matching invoice, the PDF is rendered, uploaded, and the letter is created at Pingen.
-
On success, Sent via Pingen at and Processed are updated and the change is committed.
-
On failure for a single document, the error is caught, the document is skipped, and the run continues — the overall run does not abort.
Note: On failure, Processed stays No and the invoice is retried on the next run. Persistent errors (e.g. incomplete recipient address) should be fixed manually or marked with Disable Pingen Sending to take them out of the queue.
Recommended job queue settings
|
Field |
Recommendation |
|---|---|
|
Object Type to Run |
Codeunit |
|
Object ID to Run |
|
|
Recurrence |
Daily (e.g. 06:00) or every few hours |
|
Max retries |
As needed, e.g. 3 |
Tip: A daily run is enough for most scenarios — letters don't arrive within minutes anyway. If you need faster turnaround, schedule hourly runs.
Manual override
Even with automatic dispatch active, the Send via Pingen button stays available on posted invoices — handy for sending an invoice immediately without waiting for the next job queue run.
Related
-
Send Documents Manually via Pingen
-
Enable and Disable Pingen Sending
-
Core Concepts — Posting-date delay