Why do you need this change?
Reference to #30008 and #30091
Once SetRegisters on CU 22 is public (see companion request-for-external issue), a subscriber calling it restores the Item Register and Warehouse Register state correctly. However, the G/L Register state, GLReg2, NextVATEntryNo2, NextTransactionNo2, is restored inside SetRegisters via an internal call to InventoryPostingToGL.SetGLRegister. There is no way for a subscriber to intercept or augment that G/L Register restore step from outside CU 22. The OnAfterPostItemJnlLineWhseLine subscriber in Purch.-Post needs to restore additional G/L Register fields added by a Food extension without modifying the internal call chain. No existing event in CU 22 fires at this point. An OnSetRegisters event placed at the end of SetRegisters exposes all register parameters to subscribers so each can perform their own restore step independently.
Describe the request
[W1][Codeunit][22][Item Jnl.-Post Line]
SetRegisters
Fires at the end of SetRegisters so subscribers can restore additional register state (such as extended G/L Register fields) after the standard restore logic runs.
[IntegrationEvent(false, false)]
local procedure OnSetRegisters(
var ItemReg2: Record "Item Register";
ItemApplnEntryNo2: Integer;
var WhseReg2: Record "Warehouse Register";
var GLReg2: Record "G/L Register";
NextVATEntryNo2: Integer;
NextTransactionNo2: Integer)
begin
end;
Internal work item: AB#635905
Why do you need this change?
Reference to #30008 and #30091
Once SetRegisters on CU 22 is public (see companion request-for-external issue), a subscriber calling it restores the Item Register and Warehouse Register state correctly. However, the G/L Register state, GLReg2, NextVATEntryNo2, NextTransactionNo2, is restored inside SetRegisters via an internal call to InventoryPostingToGL.SetGLRegister. There is no way for a subscriber to intercept or augment that G/L Register restore step from outside CU 22. The OnAfterPostItemJnlLineWhseLine subscriber in Purch.-Post needs to restore additional G/L Register fields added by a Food extension without modifying the internal call chain. No existing event in CU 22 fires at this point. An OnSetRegisters event placed at the end of SetRegisters exposes all register parameters to subscribers so each can perform their own restore step independently.
Describe the request
[W1][Codeunit][22][Item Jnl.-Post Line]
SetRegisters
Fires at the end of SetRegisters so subscribers can restore additional register state (such as extended G/L Register fields) after the standard restore logic runs.
[IntegrationEvent(false, false)]
local procedure OnSetRegisters(
var ItemReg2: Record "Item Register";
ItemApplnEntryNo2: Integer;
var WhseReg2: Record "Warehouse Register";
var GLReg2: Record "G/L Register";
NextVATEntryNo2: Integer;
NextTransactionNo2: Integer)
begin
end;
Internal work item: AB#635905