AL
AL copied to clipboard
Enum as Event parameter crashes client
Apparently the client crashes, when you use an enum as parameter for an Event.
Any suggestions for a workaround?
Could you give an example of AL code to reproduce the problem?
enum 50100 TestEnum
{
value(1; FirstEnumValue)
{
Caption = 'First Enum Value';
}
value(2; SecondEnumValue)
{
Caption = 'Second Enum Value';
}
}
codeunit 50100 TestEnum
{
trigger OnRun()
var
FooEnum: Enum TestEnum;
begin
TestPublisher(FooEnum::FirstEnumValue);
end;
[IntegrationEvent(false, false)]
local procedure TestPublisher(TestEnum: Enum TestEnum)
begin
end;
[EventSubscriber(ObjectType::Codeunit, Codeunit::TestEnum, 'TestPublisher', '', true, true)]
local procedure TestSubscriber(TestEnum: Enum TestEnum)
begin
If Confirm(format(TestEnum)) then;
end;
}
Used format before publish and evaluate after subscribe as a workaround for now so not critical.
Is there any timeframe for when enums will be added as a valid type throughout the system. (It isn't recognized for use with flowfields for instance, and I've experienced other places where I get a similar error.)
And do you know if enums will be part of the October BC release?