Hi,
I'd like to have a better understanding of event subscribers, integration events and IsHandled flag. Let's say there is a procedure in a base codeunit that looks like:
local procedure Procedure1()
var
IsHandled: Boolean;
begin
IsHandled := false;
FirstIntegrationEvent(IsHandled);
if IsHandled then
exit;
code
SecondIntegrationEvent();
end;
In my own codeunit, I create an event subscriber to the FirstIntegrationEvent, where I modify the code section and set IsHandled to true so the base code doesn't get executed
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Codeunit", 'FirstIntegrationEvent', '', true, true)]
local procedure "Codeunit1_FirstIntegrationEvent"
(
var IsHandled: Boolean
)
begin
baseCodeModified
//SecondIntegrationEvent(var1); //This line is removed as I can't called the 2nd integration event from my event subscriber
IsHandled := true;
end;
I'm assuming, since I'm using IsHandled, that the 2nd integration event will never be called, correct? I know I could add some code to handle it if I need to call that 2nd event trigger. But what if another app/extension is calling that 2nd integration event. That part of the code from that extension will just be ignored?
It makes no sense to me, what am I missing