Why do you need this change?
During warehouse pick creation, the standard implementation always prints pick documents individually because CreateTempLine() iterates through the generated warehouse activity headers using a repeat..until loop and invokes printing for each pick separately.
Our scenario requires group printing of all generated picks in a single report execution.
Alternatives evaluated
We evaluated subscribing to the existing OnBeforePrintPickList event. However, this event is raised inside the repeat..until loop after the pick headers have already been found.
Although the event allows replacing the actual print call, it does not allow bypassing the iteration itself. When multiple picks are created (FirstSetPickNo..LastPickNo), the subscriber is still invoked once for every pick header. Since the filters remain on the entire pick range, the request page is shown for every iteration while printing the same filtered set repeatedly.
No existing event provides an extensibility point before the pick headers are enumerated.
Implementation structure
The find/enumerate/sort/commit/print block in CreateTempLine() is first extracted into a dedicated local procedure, FindAndPrintPickHeaders(). The new OnBeforeFindAndPrintPickHeaders event with IsHandled is added around the call to this procedure, rather than directly inside the existing large block.
Justification for IsHandled
An IsHandled parameter is required because the extension needs to completely replace the standard printing flow.
A standard integration event would still continue executing the repeat..until loop and invoke the printing logic for every individual pick. The extension must be able to bypass this loop entirely and perform a single group print instead.
Performance considerations
The event is executed only once after the warehouse picks have been created and before the pick headers are retrieved.
The expected performance impact is negligible and may even improve performance by replacing multiple report executions with a single consolidated print.
Data sensitivity review
No additional sensitive data is exposed.
The event only exposes the existing Warehouse Activity Header record together with the current PrintPick flag that are already available within the standard process.
Multi-extension interaction
As with other IsHandled events, only one extension should replace the standard behavior.
If multiple extensions subscribe and set IsHandled := true, standard Business Central extensibility rules apply. In all cases, warehouse picks are still printed; the only difference is whether printing is performed individually (standard behavior) or as a consolidated group by the subscribing extension.
Describe the request
Please extract the existing find/enumerate/sort/commit/print block from CreateTempLine() into a dedicated local procedure, and add an integration event around the call to that procedure, so extensions can intercept the process before the standard iteration over the pick headers begins.
...
CreatePick.ReturnTempItemTrkgLines(TempWhseItemTrkgLine);
ItemTrackingMgt.UpdateWhseItemTrkgLines(TempWhseItemTrkgLine);
Commit();
end;
PickWhseActivHeader.SetRange(Type, PickWhseActivHeader.Type::Pick);
PickWhseActivHeader.SetRange("No.", FirstSetPickNo, LastPickNo);
//>>> New
FindAndPrintPickHeaders(PickWhseActivHeader, PrintPick, SortActivity);
end;
local procedure FindAndPrintPickHeaders(
var PickWhseActivHeader: Record "Warehouse Activity Header";
PrintPick: Boolean;
SortActivity: Option)
var
PickListReportID: Integer;
IsHandled: Boolean;
begin
IsHandled := false;
OnBeforeFindAndPrintPickHeaders(PickWhseActivHeader, PrintPick, IsHandled);
if IsHandled then
exit;
PickWhseActivHeader.Find('-');
repeat
if SortActivity <> SortActivity::None then
PickWhseActivHeader.SortWhseDoc();
Commit();
if PrintPick then begin
PickListReportID := Report::"Picking List";
OnBeforePrintPickList(PickWhseActivHeader, PickListReportID, IsHandled);
if not IsHandled then
WarehouseDocumentPrint.PrintPickHeader(PickWhseActivHeader);
end;
until PickWhseActivHeader.Next() = 0;
end;
[IntegrationEvent(false, false)]
local procedure OnBeforeFindAndPrintPickHeaders(
var PickWhseActivHeader: Record "Warehouse Activity Header";
PrintPick: Boolean;
var IsHandled: Boolean)
begin
end;
//<<< New
IsHandled bypass confirmation
The purpose of the proposed IsHandled event is to allow an extension to completely replace the standard printing flow, starting before FindAndPrintPickHeaders() performs PickWhseActivHeader.Find('-').
The standard implementation always enumerates every generated warehouse pick and performs the print logic inside the repeat..until loop. For scenarios that require consolidated/group printing, this iteration itself must be bypassed. Replacing only the print call (using OnBeforePrintPickList) is not sufficient because the subscriber is still invoked once for every generated pick.
Therefore, when IsHandled := true, the entire standard find → repeat → print flow inside FindAndPrintPickHeaders() is intentionally skipped.
Replacement behavior details
The extension assumes full responsibility for the skipped behavior.
The subscriber receives the already prepared PickWhseActivHeader record with the same filters that the standard code applies (Type = Pick and No. = FirstSetPickNo..LastPickNo).
The custom implementation will:
- Use the provided filtered record to retrieve the complete set of generated warehouse picks.
- Execute a single report run that prints all selected picks as one consolidated print job.
- Respect the
PrintPick flag and only perform printing when it is enabled.
- Not modify warehouse pick creation, warehouse activity data, or any business logic executed before the event.
- Not replace any warehouse processing other than the printing implementation.
The skipped standard code only performs enumeration of the generated pick headers and executes individual print operations. Since the extension performs the same functional outcome (printing the generated picks) in a single report execution, no business side effects are lost. The only behavioral difference is that multiple individual report executions are replaced by one consolidated print job.
Internal work item: AB#646350
Why do you need this change?
During warehouse pick creation, the standard implementation always prints pick documents individually because
CreateTempLine()iterates through the generated warehouse activity headers using arepeat..untilloop and invokes printing for each pick separately.Our scenario requires group printing of all generated picks in a single report execution.
Alternatives evaluated
We evaluated subscribing to the existing
OnBeforePrintPickListevent. However, this event is raised inside therepeat..untilloop after the pick headers have already been found.Although the event allows replacing the actual print call, it does not allow bypassing the iteration itself. When multiple picks are created (
FirstSetPickNo..LastPickNo), the subscriber is still invoked once for every pick header. Since the filters remain on the entire pick range, the request page is shown for every iteration while printing the same filtered set repeatedly.No existing event provides an extensibility point before the pick headers are enumerated.
Implementation structure
The
find/enumerate/sort/commit/printblock inCreateTempLine()is first extracted into a dedicated local procedure,FindAndPrintPickHeaders(). The newOnBeforeFindAndPrintPickHeadersevent withIsHandledis added around the call to this procedure, rather than directly inside the existing large block.Justification for IsHandled
An
IsHandledparameter is required because the extension needs to completely replace the standard printing flow.A standard integration event would still continue executing the
repeat..untilloop and invoke the printing logic for every individual pick. The extension must be able to bypass this loop entirely and perform a single group print instead.Performance considerations
The event is executed only once after the warehouse picks have been created and before the pick headers are retrieved.
The expected performance impact is negligible and may even improve performance by replacing multiple report executions with a single consolidated print.
Data sensitivity review
No additional sensitive data is exposed.
The event only exposes the existing
Warehouse Activity Headerrecord together with the currentPrintPickflag that are already available within the standard process.Multi-extension interaction
As with other
IsHandledevents, only one extension should replace the standard behavior.If multiple extensions subscribe and set
IsHandled := true, standard Business Central extensibility rules apply. In all cases, warehouse picks are still printed; the only difference is whether printing is performed individually (standard behavior) or as a consolidated group by the subscribing extension.Describe the request
Please extract the existing
find/enumerate/sort/commit/printblock fromCreateTempLine()into a dedicated local procedure, and add an integration event around the call to that procedure, so extensions can intercept the process before the standard iteration over the pick headers begins.IsHandled bypass confirmation
The purpose of the proposed IsHandled event is to allow an extension to completely replace the standard printing flow, starting before
FindAndPrintPickHeaders()performsPickWhseActivHeader.Find('-').The standard implementation always enumerates every generated warehouse pick and performs the print logic inside the
repeat..untilloop. For scenarios that require consolidated/group printing, this iteration itself must be bypassed. Replacing only the print call (usingOnBeforePrintPickList) is not sufficient because the subscriber is still invoked once for every generated pick.Therefore, when
IsHandled := true, the entire standard find → repeat → print flow insideFindAndPrintPickHeaders()is intentionally skipped.Replacement behavior details
The extension assumes full responsibility for the skipped behavior.
The subscriber receives the already prepared
PickWhseActivHeaderrecord with the same filters that the standard code applies (Type = PickandNo. = FirstSetPickNo..LastPickNo).The custom implementation will:
PrintPickflag and only perform printing when it is enabled.The skipped standard code only performs enumeration of the generated pick headers and executes individual print operations. Since the extension performs the same functional outcome (printing the generated picks) in a single report execution, no business side effects are lost. The only behavioral difference is that multiple individual report executions are replaced by one consolidated print job.
Internal work item: AB#646350