Skip to content

[Request for external] [W1][Codeunit][22][Item Jnl.-Post Line] Add public GetRegisters procedure #30093

@mavohra

Description

@mavohra

Why do you need this change?

#30007

Why do you need this change?
Purch.-Post publishes two integration events bracketing the warehouse journal posting step:

OnBeforePostItemJnlLineWhseLine
OnAfterPostItemJnlLineWhseLine
For warehouse-enabled purchase posting we need to move register state around the warehouse posting call:

before warehouse posting: Item Jnl.-Post Line.GetRegisters->Whse. Jnl.-Register Line.SetRegisters`
after warehouse posting: Whse. Jnl.-Register Line.GetRegisters -> Item Jnl.-Post Line.SetRegisters
The required procedures are not available in the BC 28 base application.

We subscribe to OnBeforePostItemJnlLineWhseLine on Purch.-Post and need to read the current register state from Item Jnl.-Post Line before the warehouse posting starts.

Current flow:

OnBeforePostItemJnlLineWhseLine:
  → ItemJnlPostLine.GetRegisters(ItemReg2, ItemApplnEntryNo2, WhseReg2, GLReg2,
            NextVATEntryNo2, NextTransactionNo2)                    // Read from `Item Jnl.-Post Line`
  → WhseJnlPostLine.SetRegisters(...)                         // Seed into `Whse. Jnl.-Register Line` 
  [BC standard warehouse posting]

Item Jnl.-Post Line has no public procedure to read its register state (ItemReg, ItemLedgEntryNo, PhysInvtEntryNo, ValueEntryNo, CapLedgEntryNo, ItemApplnEntryNo).

OnAfterPostItemJnlLine is not enough here because it fires after Item Jnl.-Post Line has already finished posting. We need a direct read at the point where Purch.-Post is about to hand off to warehouse posting.

Describe the request

Please Add this procedure to codeunit 22 "Item Jnl.-Post Line":

public procedure GetRegisters(
    var ItemReg2: Record "Item Register";
    var ItemApplnEntryNo2: Integer;
    var WhseReg2: Record "Warehouse Register";
    var GLReg2: Record "G/L Register";
    var NextVATEntryNo2: Integer;
    var NextTransactionNo2: Integer)
begin
    ItemReg2 := ItemReg;
    ItemApplnEntryNo2 := ItemApplnEntryNo;
end;

Internal work item: AB#635917

Metadata

Metadata

Assignees

No one assigned

    Labels

    SCMGitHub request for SCM arearequest-for-externalRequest for exposing a function for extension development

    Type

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions