-
Notifications
You must be signed in to change notification settings - Fork 688
Description
Why do you need this change?
A client has a requirement to adjust byproduct costs after a Production Order has been finished. However, when using the standard Microsoft ReopenFinishedProdOrder procedure, the underlying procedure ShowReleasedProdOrderDocument in Codeunit 5407 Prod. Order Status Management always displays a confirmation dialog.
This behavior prevents Finished Production Orders from being reopened from background or automated processes where confirmation is not required or not possible. Since there is no IntegrationEvent or IsHandled extensibility point, extensions cannot suppress or override this behavior, forcing partners to implement workarounds or bypass standard logic.
Adding an IntegrationEvent with the IsHandled pattern would enable background and automation scenarios while preserving the existing UI behavior.
Alternatives Evaluated : We evaluated invoking the internal procedure ProcessProdOrderForReopen from our own custom procedure in order to bypass the ShowReleasedProdOrderDocument logic executed by ReopenFinishedProdOrder. However, this approach is not feasible because ProcessProdOrderForReopen is defined as a local procedure.
Describe the request
In Codeunit 5407 ΓÇô Prod. Order Status Management, the procedure ShowReleasedProdOrderDocument always displays a confirmation dialog. This confirmation is triggered unconditionally and cannot be suppressed.
We request an IntegrationEvent to be added using the IsHandled pattern in the procedure ShowReleasedProdOrderDocument, allowing extensions to suppress the confirmation dialog and the associated Page.Run logic when required.
Proposed Code Change :
local procedure ShowReleasedProdOrderDocument(var ProdOrder: Record "Production Order")
var
NewProductionOrder: Record "Production Order";
IsHandled: Boolean; //Proposed Code
begin
IsHandled := false; //Proposed Code
OnBeforeOpenReleasedProdOrderConfirm(ProdOrder,IsHandled); //Proposed Code
if IsHandled then //Proposed Code
exit; //Proposed Code
if not Confirm(StrSubstNo(OpenReleasedProdOrderQst, ProdOrder."No.")) then
exit;
NewProductionOrder.Get(NewProductionOrder.Status::Released, ProdOrder."No.");
Page.Run(Page::"Released Production Order", NewProductionOrder);
end;
//>> Proposed Code
[IntegrationEvent(false, false)]
local procedure OnBeforeOpenReleasedProdOrderConfirm(ProductionOrder: Record "Production Order";var IsHandled: Boolean)
begin
end;
//<<Proposed Code
Internal work item: AB#622679