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 7303 "Whse. Jnl.-Register".Code #27702

Open
fridrichovsky opened this issue Nov 26, 2024 · 0 comments
Open

[Event Request] Codeunit 7303 "Whse. Jnl.-Register".Code #27702

fridrichovsky opened this issue Nov 26, 2024 · 0 comments
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

local procedure "Code"()
    var
        IsHandled: Boolean;
    begin
        IsHandled := false;
        OnBeforeCode(WhseJnlLine, IsHandled);
        if IsHandled then
            exit;

        WhseJnlTemplate.Get(WhseJnlLine."Journal Template Name");
        WhseJnlTemplate.TestField("Force Registering Report", false);

        if not ConfirmRegisterLines(WhseJnlLine) then
            exit;

        TempJnlBatchName := WhseJnlLine."Journal Batch Name";

        CODEUNIT.Run(CODEUNIT::"Whse. Jnl.-Register Batch", WhseJnlLine);

        //----------------------------------------------------------------------OnCodeOnBeforeRegisterWarehouseJournalLine:BEGIN
        IsHandled := false;
        OnCodeOnBeforeRegisterWarehouseJournalLine(WhseJnlLine, TempJnlBatchName, IsHandled);
        if not IsHandled then
            //----------------------------------------------------------------------OnCodeOnBeforeRegisterWarehouseJournalLine:END
            if WhseJnlLine."Line No." = 0 then
                Message(Message002Txt)
            else
                if TempJnlBatchName = WhseJnlLine."Journal Batch Name" then
                    Message(Message003Txt)
                else
                    Message(
                      Message003Txt +
                      Message004Txt,
                      WhseJnlLine."Journal Batch Name");

        if not WhseJnlLine.Find('=><') or (TempJnlBatchName <> WhseJnlLine."Journal Batch Name") then begin
            WhseJnlLine.Reset();
            WhseJnlLine.FilterGroup(2);
            WhseJnlLine.SetRange("Journal Template Name", WhseJnlLine."Journal Template Name");
            WhseJnlLine.SetRange("Journal Batch Name", WhseJnlLine."Journal Batch Name");
            WhseJnlLine.SetRange("Location Code", WhseJnlLine."Location Code");
            WhseJnlLine.FilterGroup(0);
            WhseJnlLine."Line No." := 10000;
        end;
    end;

    //----------------------------------------------------------------------OnCodeOnBeforeRegisterWarehouseJournalLine:BEGIN
    [IntegrationEvent(true, false)]
    local procedure OnCodeOnBeforeRegisterWarehouseJournalLine(var WhseJnlLine: Record "Warehouse Journal Line"; var TempJnlBatchName: Code[10]; var IsHandled: Boolean)
    begin
    end;
    //----------------------------------------------------------------------OnCodeOnBeforeRegisterWarehouseJournalLine:END

Additional context

We have own messages and plus own another messages.
Internal work item: AB#558861

@fridrichovsky fridrichovsky changed the title [Event Request] [Event Request] Codeunit 7303 "Whse. Jnl.-Register".Code Nov 26, 2024
@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