-
Notifications
You must be signed in to change notification settings - Fork 688
Description
Why do you need this change?
Problem statement
Currently, the procedures GetGlobalDimNo() in Table 480 "Dimension Set Entry" and GetGlobalDimensionNo() in Table 349 "Dimension Value" resolve global and shortcut dimension numbers exclusively based on the fields defined in General Ledger Setup.
Our customers have requested the addition of extra Shortcut Dimensions in the General Ledger Setup. To ensure the system operates correctly, the two functions must be modified to take the additional shortcut dimensions into account
There is no extensibility point that allows partners to override or replace this logic. The procedures are local, and no events are raised before the base resolution logic executes.
Describe the request
Currently, the procedures GetGlobalDimNo() in Table 480 "Dimension Set Entry" and GetGlobalDimensionNo() in Table 349 "Dimension Value" resolve global and shortcut dimension numbers exclusively based on the fields defined in General Ledger Setup.
We are requesting the addition of extra Shortcut Dimensions in the General Ledger Setup. To ensure the system operates correctly, the two functions must be modified to take the additional shortcut dimensions into account
Proposed code snippet
a) Table 480 ΓÇô Dimension Set Entry
procedure GetGlobalDimNo(): Integer
var
GeneralLedgerSetup: Record "General Ledger Setup";
GlobalDimNo: Integer; //new code
IsHandled: Boolean; //new code
begin
//new code begin <<
OnBeforeGetGlobalDimNo("Dimension Code", GlobalDimNo, IsHandled);
if IsHandled then
exit(GlobalDimNo);
//new code end <<
GeneralLedgerSetup.Get();
if "Dimension Code" = GeneralLedgerSetup."Shortcut Dimension 3 Code" then
exit(3);
if "Dimension Code" = GeneralLedgerSetup."Shortcut Dimension 4 Code" then
exit(4);
if "Dimension Code" = GeneralLedgerSetup."Shortcut Dimension 5 Code" then
exit(5);
…
end;
[IntegrationEvent(false, false)]
local procedure OnBeforeGetGlobalDimNo(
DimensionCode: Code[20];
var GlobalDimNo: Integer;
var IsHandled: Boolean)
begin
end;
b)
Table 349 ΓÇô Dimension Value
local procedure GetGlobalDimensionNo(): Integer
var
GeneralLedgerSetup: Record "General Ledger Setup";
GlobalDimNo: Integer; //new code
IsHandled: Boolean; //new code
Begin
//new code begin <<
OnBeforeGetGlobalDimensionNo("Dimension Code", GlobalDimNo, IsHandled);
if IsHandled then
exit(GlobalDimNo);
//new code end <<
GeneralLedgerSetup.Get();
case "Dimension Code" of
GeneralLedgerSetup."Global Dimension 1 Code":
exit(1);
GeneralLedgerSetup."Global Dimension 2 Code":
exit(2);
GeneralLedgerSetup."Shortcut Dimension 3 Code":
exit(3);
…
end;
end;
[IntegrationEvent(false, false)]
local procedure OnBeforeGetGlobalDimensionNo(
DimensionCode: Code[20];
var GlobalDimNo: Integer;
var IsHandled: Boolean)
begin
end;
Alternatives evaluated
No existing events are raised before or during the dimension number resolution in either table.
A standard event would not allow suppressing the base logic, as there is no way to influence the return value produced by these functions.
Justification for using IsHandled over alternatives
Our business logic must extend it the standard behavior, not replace it.
Specifically, additional shortcut dimensions must be supported, and these two functions should consider them during processing. A non-IsHandled event cannot help in making these functions return values for shortcut dimensions beyond 8.
Therefore, the IsHandled pattern is required.
Performance considerations
The additional IsHandled check introduces no loops, database access, or locking.
Data sensitivity review
No sensitive or personal data is exposed. The change affects only internal business logic related to custom shortcut dimensions.
Multi-extension interaction
This event considers only our custom fields, which are not present in other partners extensions, ensuring it does not interfere with or get influenced by other extensions.
Note that this request is further to the #29427
Internal work item: AB#620494