Hi everyone,
I’m trying to implement a functionality that automatically prints Warehouse Shipment documents right after they are posted.
To achieve this, I subscribed to an event that should trigger the printing after posting. However, when I test the process using my PDA device (via Warehouse Insight by Insight Works), I still encounter an error message and the document is not printed.
Has anyone successfully implemented automatic printing in this scenario, especially when using Warehouse Insight?
Any guidance on:
-
Best practices for triggering reports automatically
-
Or handling this specifically with Warehouse Insight / PDA devices
would be greatly appreciated.
Thanks in advance!
[EventSubscriber(ObjectType::CODEUNIT, CODEUNIT::"Sales-Post", 'OnAfterPostSalesDoc', '', false, false)]
local procedure OnAfterPostSalesDoc(var SalesHeader: Record "Sales Header"; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line"; SalesShptHdrNo: Code[20]; RetRcpHdrNo: Code[20]; SalesInvHdrNo: Code[20]; SalesCrMemoHdrNo: Code[20]; CommitIsSuppressed: Boolean; InvtPickPutaway: Boolean; var CustLedgerEntry: Record "Cust. Ledger Entry"; WhseShip: Boolean; WhseReceiv: Boolean; PreviewMode: Boolean)
var
SalesShipmentHeader: Record "Sales Shipment Header";
begin
if SalesShptHdrNo <> '' then begin
SalesShipmentHeader.SetRange("No.", SalesShptHdrNo);
SalesShipmentHeader.PrintRecords(false);
end;
end;

Report
All responses (
Answers (