Integration events must not be declared in codeunits with Access set to Internal (AC0012)
Integration events are designed to be consumed by extensions and therefore must be accessible outside the defining app. When an IntegrationEvent is declared in a codeunit with Access = Internal, the event cannot be subscribed to by extensions, rendering it ineffective.
If the event is intended for internal use only within the same app, it should be declared as an InternalEvent instead.
A code fix is available for this diagnostic.
Example
The following integration event is declared in an internal codeunit:
codeunit 50100 MyCodeunit
{
Access = Internal;
[IntegrationEvent(false, false)]
procedure OnBeforeSomething() // Integration event 'OnBeforeSomething' is declared in a codeunit with Access = Internal, making it inaccessible to extensions. Remove the Access property or declare the event as an InternalEvent. [AC0012]
begin
end;
}
To fix this, either remove the Access property from the codeunit or change the event to InternalEvent:
codeunit 50100 MyCodeunit
{
Access = Internal;
[InternalEvent(false, false)]
procedure OnBeforeSomething()
begin
end;
}