ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Event Request] page 501 "Available - Purchase Lines" - OnAfterOpenPage

Open MiRo65 opened this issue 6 years ago • 5 comments

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;

MiRo65 avatar Jan 28 '20 12:01 MiRo65

Please explain why do you want codeunits as parameters?

AlexanderYakunin avatar Feb 05 '20 11:02 AlexanderYakunin

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);

StHillmann avatar Mar 19 '20 11:03 StHillmann

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.

AlexanderYakunin avatar Mar 23 '20 09:03 AlexanderYakunin

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...

StHillmann avatar Mar 23 '20 11:03 StHillmann

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.

bc-ghost avatar Mar 24 '20 07:03 bc-ghost