ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

Codeunit 5407 - "Prod. Order Status Management" - make procedure CheckBeforeFinishProdOrder public

Open matthiasrabus opened this issue 1 year ago • 2 comments

Why do you need this change?

We are converting one C/AL customer to the latest BC version. This customer has some changes to the standard codeunit "Prod. Order Status Management" to expose some functionality to other objects. To replicate the behavior, I would like to request the following change

Describe the request

Make the function not local:

Current:

    local procedure CheckBeforeFinishProdOrder(ProdOrder: Record "Production Order")
    var
        ProdOrderLine: Record "Prod. Order Line";
        ProdOrderComp: Record "Prod. Order Component";
        ProdOrderRtngLine: Record "Prod. Order Routing Line";
        PurchLine: Record "Purchase Line";
        ConfirmManagement: Codeunit "Confirm Management";
        ShowWarning: Boolean;
        IsHandled: Boolean;
    begin
        IsHandled := false;
        OnBeforeCheckBeforeFinishProdOrder(ProdOrder, IsHandled);
        if IsHandled then
            exit;

Changed:

//CHANGED
    procedure CheckBeforeFinishProdOrder(ProdOrder: Record "Production Order")
//CHANGED
    var
        ProdOrderLine: Record "Prod. Order Line";
        ProdOrderComp: Record "Prod. Order Component";
        ProdOrderRtngLine: Record "Prod. Order Routing Line";
        PurchLine: Record "Purchase Line";
        ConfirmManagement: Codeunit "Confirm Management";
        ShowWarning: Boolean;
        IsHandled: Boolean;
    begin
        IsHandled := false;
        OnBeforeCheckBeforeFinishProdOrder(ProdOrder, IsHandled);
        if IsHandled then
            exit;

Internal work item: AB#599971

matthiasrabus avatar Sep 03 '25 13:09 matthiasrabus

There are already some events within the function. What exactly is the reason for opening the procedure?

PredragMaricic avatar Oct 09 '25 09:10 PredragMaricic

Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. Please do not reply to this, as we do not monitor closed issues. If you have follow-up questions or requests, please create a new issue where you reference this one.

Build ID: 41088.

JesperSchulz avatar Oct 17 '25 05:10 JesperSchulz