[W1][Page][537][Dimension Values] OnBeforeOnOpenPage event
Why do you need this change?
Dear Microsoft Team, I would like to request a new event, OnBeforeOnOpenPage, in the trigger OnOpenPage of a page Dimension Values. We need this event for custom filtering and validating the "Dimension Code" from the user's input, ensuring valid selections are processed.
Describe the request
I propose adding a new event, OnBeforeOnOpenPage, in the OnOpenPage trigger. This event will allow include custom pre-processing logic and bypass the standard behavior. Proposed Event Code:
[W1][Page][537][Dimension Values]
trigger OnOpenPage()
___
The event is needed for implementing custom filtering and bypassing standard filtering with GetRangeMin.
It resolves issues where GetRangeMin works incorrectly with a non-single range "Dimension Code" filter (multiple values in the filter).
___
[IntegrationEvent(false, false)]
local procedure OnBeforeOnOpenPage(var Rec: Record "Dimension Value"; var IsHandled: Boolean)
begin
end;
Proposed Procedure Code:
trigger OnOpenPage()
var
DimensionCode: Code[20];
IsHandled: Boolean;
begin
IsHandled := false;
OnBeforeOnOpenPage(Rec, IsHandled);
if IsHandled then
exit;
if Rec.GetFilter("Dimension Code") <> '' then
DimensionCode := Rec.GetRangeMin("Dimension Code");
if DimensionCode <> '' then begin
Rec.FilterGroup(2);
Rec.SetRange("Dimension Code", DimensionCode);
Rec.FilterGroup(0);
end;
end;
Internal work item: AB#597136
Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. Please do not reply to this, as we do not monitor closed issues. If you have follow-up questions or requests, please create a new issue where you reference this one.
Build ID: