[Event Request] page 501 "Available - Purchase Lines" - OnAfterOpenPage
Could we please have additional parameters (ReservMgt, ReservEngineMgt, CaptionText) in event OnAfterOpenPage in page 501?
case CurrentSubType of
0, 1, 2, 4:
if ReservMgt.IsPositive then
SetFilter("Quantity (Base)", '>0')
else
SetFilter("Quantity (Base)", '<0');
3, 5:
if ReservMgt.IsPositive then
SetFilter("Quantity (Base)", '<0')
else
SetFilter("Quantity (Base)", '>0');
end;
// start kvspsa - Additional Parameters
OnAfterOpenPage(Rec, ReservEntry, ReservMgt, ReservEngineMgt, CaptionText);
// stop kvspsa
end;
Event:
local procedure OnAfterCode(var WarehouseActivityLine: Record "Warehouse Activity Line"; PrintDoc: Boolean)
begin
end;
Please explain why do you want codeunits as parameters?
From my point of view, we need the codeunits as parameters because of the usage of global variables inside of the codeunits. By using the codeunit itself as parameter we are using the same instance and therefore can use the same globals of the codeunits.
Therefore please add these parameters to the existing event publisher and change OnAfterOpenPage(Rec, ReservEntry);
to
OnAfterOpenPage(Rec, ReservEntry, ReservMgt, ReservEngineMgt, CaptionText);
We currently have new possibility to move some global variables to "protected var" area, such variables will be fully available in page extension for your development. Would it be better to use this design patters to give you direct access to same instance of global variables? Let me know.
As I know, the "protected var" is only working between page and page extension or table and table extension. But in this case, we are subscribing to an event of the page in a codeunit! Is the way you announced possible for my case? I don`t know how...
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. We will update this issue with information about availability.