Skip to content

[W1][Codeunit][99000760]["Mfg. Item Jnl. Check Line"][Procedure OnRunOnCheckWarehouse - NewEvent OnBeforeOnRunOnCheckWarehouse] #30239

Description

@gangabhushan-std2026

Why do you need this change?

We currently have two subscribers associated with the OnRunOnCheckWarehouse publisher event: one provided by the standard Microsoft application and another implemented in our extension.

When posting Consumption transactions through our application, the warehouse validation logic executed in the local procedure OnRunOnCheckWarehouse of codeunit 99000760 "Mfg. Item Jnl. Check Line" is preventing further processing as it is called by MS standard event.

To handle this scenario, we require a handler event to conditionally bypass this validation logic for transactions from our application. Provide an extensibility point (publisher event) within OnRunOnCheckWarehouse would allow extensions to skip the standard validation, when necessary, while preserving the existing behavior for all other scenarios.

Describe the request

Introduce a new publisher 'OnBeforeOnRunOnCheckWarehouse' event in procedure OnRunOnCheckWarehouse that allows extensions to skip the standard validation logic when required from our application.

[EventSubscriber(ObjectType::Codeunit, Codeunit::"Item Jnl.-Check Line", 'OnRunOnCheckWarehouse', '', true, false)]
local procedure OnRunOnCheckWarehouse(var ItemJournalLine: Record "Item Journal Line"; CalledFromAdjustment: Boolean; CalledFromInvtPutawayPick: Boolean)
var
ProdOrderLine: Record "Prod. Order Line";
WorkCenter: Record "Work Center";
IsHandled: Boolean;
ShouldCheckItemNo: Boolean;
Begin
// New Event Request>>
IsHandled := false;
OnBeforeOnRunOnCheckWarehouse(ItemJournalLine, CalledFromAdjustment, CalledFromInvtPutawayPick, IsHandled);
if IsHandled then
exit;
// New Event Request<<

    if (ItemJournalLine."Entry Type" in [ItemJournalLine."Entry Type"::Consumption, ItemJournalLine."Entry Type"::Output]) and
       not (ItemJournalLine."Value Entry Type" = ItemJournalLine."Value Entry Type"::Revaluation) and
       not ItemJournalLine.OnlyStopTime()
    then begin
        ItemJournalLine.TestField("Source No.", ErrorInfo.Create());
        ItemJournalLine.TestField("Order Type", ItemJournalLine."Order Type"::Production, ErrorInfo.Create());
        ShouldCheckItemNo := not CalledFromAdjustment and (ItemJournalLine."Entry Type" = ItemJournalLine."Entry Type"::Output);
        OnRunCheckOnAfterCalcShouldCheckItemNo(ItemJournalLine, ProdOrderLine, CalledFromAdjustment, ShouldCheckItemNo);
        .....
        .....
    end;
end;



[IntegrationEvent(false, false)]
local procedure OnBeforeOnRunOnCheckWarehouse(var ItemJournalLine: Record "Item Journal Line"; CalledFromAdjustment: Boolean; CalledFromInvtPutawayPick: Boolean; var IsHandled: Boolean)
begin
end;

Internal work item: AB#642012

Metadata

Metadata

Assignees

No one assigned

    Labels

    SCMGitHub request for SCM areaevent-requestRequest for adding an event

    Type

    Fields

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions