Skip to content

[Request-For-External] [W1][Codeunit][5802][Inventory Posting to G/L] Add public SetGLRegister procedure #30116

@mavohra

Description

@mavohra

Why do you need this change?

We need to restore a previously captured G/L Register state, including the next VAT entry number and next transaction number, into the GenJnlPostLine codeunit instance held internally by Codeunit 5802 "Inventory Posting to G/L". This is required when coordinating posting across multiple inventory posting calls where the register state must be captured before a run and restored afterward to preserve correct register sequencing.

The standard Codeunit 5802 holds GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line" as a private codeunit-level variable. Codeunit "Gen. Jnl.-Post Line" already exposes SetGLRegister as a public procedure. However, Codeunit 5802 has no corresponding public procedure that delegates to GenJnlPostLine.SetGLRegister, so external code cannot set this state without direct access to the internal variable.

No existing public procedure or event on Codeunit 5802 allows an external caller to write GLReg, NextVATEntryNo, or NextTransactionNo back to the internal GenJnlPostLine instance. This is the symmetric counterpart to the missing GetGLRegister procedure.

Describe the request

Add a public procedure SetGLRegister in Codeunit 5802 "Inventory Posting to G/L" that delegates to the internal GenJnlPostLine.SetGLRegister.

procedure SetGLRegister(var GLReg: Record "G/L Register"; NextVATEntryNo: Integer; NextTransactionNo: Integer)
begin
    GenJnlPostLine.SetGLRegister(GLReg, NextVATEntryNo, NextTransactionNo);
end;

Alternatives evaluated: There is no public procedure on Codeunit 5802 that writes to the internal GenJnlPostLine register state. No event on Codeunit 5802 exposes GenJnlPostLine as a var parameter that would allow a subscriber to call SetGLRegister on it directly. There is no other public path to restore all three values together.

Metadata

Metadata

Assignees

No one assigned

    Labels

    missing-infoThe issue misses information that prevents it from completion.

    Type

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions