Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Event Request] Codeunit 7302 "WMS Management".CheckItemJnlLineLocation #27701

Open
fridrichovsky opened this issue Nov 26, 2024 · 0 comments
Open
Labels
event-request Request for adding an event SCM GitHub request for SCM area

Comments

@fridrichovsky
Copy link
Contributor

fridrichovsky commented Nov 26, 2024

Describe the request

Please add new event

procedure CheckItemJnlLineLocation(var ItemJournalLine: Record "Item Journal Line"; xItemJournalLine: Record "Item Journal Line")
    var
        WhseItemJournal: Page "Whse. Item Journal";
        TransferOrder: Page "Transfer Order";
        IsHandled: Boolean;
    begin
        IsHandled := false;
        OnBeforeCheckItemJnlLineLocation(ItemJournalLine, xItemJournalLine, IsHandled);
        if IsHandled then
            exit;

        if ItemJournalLine."Entry Type" in
            [ItemJournalLine."Entry Type"::"Negative Adjmt.", ItemJournalLine."Entry Type"::"Positive Adjmt.", ItemJournalLine."Entry Type"::Sale, ItemJournalLine."Entry Type"::Purchase]
        then
            if ItemJournalLine."Location Code" <> xItemJournalLine."Location Code" then begin
                GetLocation(xItemJournalLine."Location Code");
                if not Location."Directed Put-away and Pick" then begin
                    GetLocation(ItemJournalLine."Location Code");
                    //-----------------------------------------------------------------OnCheckItemJnlLineLocationOnBeforeCheckErrorDirectedPutawayAndPick:BEGIN
                    IsHandled := false;
                    OnCheckItemJnlLineLocationOnBeforeCheckErrorDirectedPutawayAndPick(ItemJournalLine, xItemJournalLine, Location, IsHandled)
                    if not IsHandled then
                    //-----------------------------------------------------------------OnCheckItemJnlLineLocationOnBeforeCheckErrorDirectedPutawayAndPick:END
                        if Location."Directed Put-away and Pick" then
                            Error(Text011,
                              LowerCase(Location.TableCaption()), Location.Code, Location.FieldCaption("Directed Put-away and Pick"),
                              WhseItemJournal.Caption());
                end;
            end;

        if ItemJournalLine."Entry Type" = ItemJournalLine."Entry Type"::Transfer then begin
            if (ItemJournalLine."New Location Code" <> ItemJournalLine."Location Code") and
               ((ItemJournalLine."Location Code" <> xItemJournalLine."Location Code") or
                (ItemJournalLine."New Location Code" <> xItemJournalLine."New Location Code"))
            then begin
                GetLocation(ItemJournalLine."Location Code");
                ShowError := Location."Directed Put-away and Pick";
                if not Location."Directed Put-away and Pick" then begin
                    GetLocation(ItemJournalLine."New Location Code");
                    ShowError := Location."Directed Put-away and Pick";
                end;
            end;

            if ShowError then
                Error(Text012,
                  LowerCase(Location.TableCaption()), Location.Code, Location.FieldCaption("Directed Put-away and Pick"),
                  TransferOrder.Caption);
        end;
    end;

    //-----------------------------------------------------------------OnCheckItemJnlLineLocationOnBeforeCheckErrorDirectedPutawayAndPick:BEGIN
    [IntegrationEvent(true, false)]
    local procedure OnCheckItemJnlLineLocationOnBeforeCheckErrorDirectedPutawayAndPick(var ItemJournalLine: Record "Item Journal Line"; xItemJournalLine: Record "Item Journal Line"; var Location: Record Location; var IsHandled: Boolean)
    begin
    end;
    //-----------------------------------------------------------------OnCheckItemJnlLineLocationOnBeforeCheckErrorDirectedPutawayAndPick:END

Additional context

we need option how to skip error Text011. We have own check function.
Internal work item: AB#558862

@ChethanT ChethanT added event-request Request for adding an event SCM GitHub request for SCM area labels Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
event-request Request for adding an event SCM GitHub request for SCM area
Projects
None yet
Development

No branches or pull requests

2 participants