Closed sidser closed 4 years ago
Hi! Please take a minute to read the guidelines for this repository https://github.com/microsoft/AL and our collection of frequently asked questions https://github.com/Microsoft/AL/wiki/frequently-Asked-Questions .
As this repository is only for issues related to the AL compiler in latest developer preview environment for Dynamics 365 Business Central. We suggest that you open a support case or file a bug in Collaborate, to ensure that all Business Central users benefit from your catch as soon as possible.
To open a support case, you can:
If you file the bug in Collaborate, remember to include steps to reproduce the issue, and the Business Central build number and country version you're using.
I just hit the same limitation. I will file a bug on collaborate.
Describe the bug If some page action does not contain any logic on OnAction trigger then OnBeforeActionEvent is not triggered and corresponding subscribers are not executed.
To Reproduce Steps and to reproduce the behavior: 1.
AL Code to reproduce the issue
a) Create event subscriber and subscribe to OnBeforeActionEvent of the page action that has some logic on OnAction trigger. Put some logic in the created event subscriber.For example, I created two OnBeforeActionEvent subscribers
codeunit 50000 "Test Subscriber" { [EventSubscriber(ObjectType::Page, Page::"Customer Card", 'OnBeforeActionEvent', 'NewSalesInvoice', true, true)] local procedure OnBeforeActionNewSalesInvoice() var ConfirmQst: Label 'Are you sure you want to execute this action?'; begin // Some code, for example If Confirm(ConfirmQst) then; // This code is not executed. NewSalesInvoice action does not have OnAction trigger but has RunObject = Page "Sales Invoice" end;
} b) Publish and Install your changes to Business Central c) Open "Customer Card" for any customer and
Expected behavior OnBeforeAction event has to be triggered for page actions that do not have OnAction trigger and corresponding subscribers have to be executed.
Screenshots
5. Versions: