EventSubscriber on the page action
Hi,
I have an EventSubscriber on th page 393, action35. After I converted to the AL, I got this, [EventSubscriber(ObjectType::Page, 393, 'OnBeforeActionEvent', 'Action35', false, false)]
Now, the VS Code is complaining "[AL] The action 'Action35' is not found in the target". The action35 name in the page is "<"Action35">" (no double quotes in the real code). I tried [EventSubscriber(ObjectType::Page, 393, 'OnBeforeActionEvent', "<"Action35">", false, false)], still got the same error.
Another question, Can I add an EventSubscriber on a pageextension action ?
I am using, Microsoft_System_13.0.12929.0.app Microsoft_Application_13.0.24266.0.app AL Language 2.0.41872
Hello,
try this
_codeunit 50130 xxx { EventSubscriberInstance = StaticAutomatic;
[EventSubscriber(ObjectType::Page, Page::"Item Reclass. Journal", 'OnBeforeActionEvent', 'Post and &Print', false, false)] local procedure MyProcedure() begin
end; }_
Rather than specifying ID's use the real names of the objects/actions. Let me know if it helps
best regards, Thomas Barbut
'Post and &Print' is working. Doesn't have to be the page name.