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 7301 "Whse. Jnl.-Register Line".InsertWhseReg #27699

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

local procedure InsertWhseReg(WhseEntryNo: Integer)
    begin
        if WhseReg."No." = 0 then begin
            WhseReg.Init();
            WhseReg."No." := WhseReg.GetNextEntryNo(WarehouseSetup.UseLegacyPosting());
            WhseReg."From Entry No." := WhseEntryNo;
            WhseReg."To Entry No." := WhseEntryNo;
            WhseReg."Creation Date" := Today;
            WhseReg."Creation Time" := Time;
            WhseReg."Journal Batch Name" := WhseJnlLine."Journal Batch Name";
            WhseReg."Source Code" := WhseJnlLine."Source Code";
            WhseReg."User ID" := CopyStr(UserId(), 1, MaxStrLen(WhseJnlLine."User ID"));
            //-------------------------------------------------------OnInsertWhseRegOnBeforeInsertRecord:BEGIN
            OnInsertWhseRegOnBeforeInsertRecord(WhseReg, WhseJnlLine, WhseEntryNo);
            //-------------------------------------------------------OnInsertWhseRegOnBeforeInsertRecord:END
            WhseReg.InsertRecord(WarehouseSetup.UseLegacyPosting());
        end else begin
            if ((WhseEntryNo < WhseReg."From Entry No.") and (WhseEntryNo <> 0)) or
               ((WhseReg."From Entry No." = 0) and (WhseEntryNo > 0))
            then
                WhseReg."From Entry No." := WhseEntryNo;
            if WhseEntryNo > WhseReg."To Entry No." then
                WhseReg."To Entry No." := WhseEntryNo;
            //-------------------------------------------------------OnInsertWhseRegOnBeforeModifyWarehouseRegister:BEGIN
            OnInsertWhseRegOnBeforeModifyWarehouseRegister(WhseReg, WhseJnlLine, WhseEntryNo);
            //-------------------------------------------------------OnInsertWhseRegOnBeforeModifyWarehouseRegister:END
            WhseReg.Modify();
        end;
    end;

    //-------------------------------------------------------OnInsertWhseRegOnBeforeInsertRecord:BEGIN
    [IntegrationEvent(true, false)]
    local procedure OnInsertWhseRegOnBeforeInsertRecord(var WhseReg: Record "Warehouse Register"; var WhseJnlLine: Record "Warehouse Journal Line"; WhseEntryNo: Integer)
    begin
    end;
    //-------------------------------------------------------OnInsertWhseRegOnBeforeInsertRecord:END

    //-------------------------------------------------------OnInsertWhseRegOnBeforeModifyWarehouseRegister:BEGIN
    [IntegrationEvent(true, false)]
    local procedure OnInsertWhseRegOnBeforeModifyWarehouseRegister(var WhseReg: Record "Warehouse Register"; var WhseJnlLine: Record "Warehouse Journal Line"; WhseEntryNo: Integer)
    begin
    end;
    //-------------------------------------------------------OnInsertWhseRegOnBeforeModifyWarehouseRegister:END
 

Additional context

We need option change record before insert or modify.
Internal work item: AB#558863

@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