Skip to content

Add Integration Event to Suppress Confirmation Dialog & Page.Run in Procedure ShowReleasedProdOrderDocument #29682

@neeraj1214

Description

@neeraj1214

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    SCMGitHub request for SCM areaevent-requestRequest for adding an event

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions