Al: Sugestion: Remove Begin and End from event definition in AL

Created on 7 Jun 2017  路  6Comments  路  Source: microsoft/AL

Why there is a "Begin" and "End" for events - there can be no code.

[BusinessEvent(false)]
local procedure MyProcedure();
begin
end;

better Syntax:

[BusinessEvent(false)]
local procedure MyProcedure();
al-language suggestion

All 6 comments

Why is there an attribute and brackets? I think even better would be the following:
csharp local businessevent MyProcedure;

What about this syntax?

local business event MyEventName;

local integration event MyEventName;

To be honest, I find a separation between business and integration stupid. Event is event.
csharp local event MyEventName;

But if the separation I find your syntax well

I agree with you and I think the reason of separation (...An integration event is also a custom event that is raised by C/AL code, like a business event, except that it does not carry the same promise of not changing, nor does it have the restriction not to expose implementation details.) will become obsolate.

The new binding concept in AL does not need this limitation. The variable signature of subscribers for event is a good step in the right direction.

Why is there an attribute and brackets?

There are brackets because events can be emitted with arguments, and in AL unlike C/AL we don't omit brackets just because there's nothing between them. I guess they're a procedure with a special attribute just because they are emitted with procedure call syntax.

Was this page helpful?
0 / 5 - 0 ratings