Edit

Compiler Error AL0919

Note

The AL diagnostics topics are in preview. If you have input for this topic, we'd love to hear from you. Use our GitHub repo to create a PR and add content to this topic by going to here. To read about contributing, see Contribute to the Help. Thanks!

The Scope attribute is not allowed on interface members.

Description

Interface methods cannot have specific compilation scope restrictions because interfaces must be implementable by any codeunit regardless of its scope.

Remarks

Interface methods define a contract that any implementing codeunit must fulfill. Applying a Scope attribute to an interface method would restrict which codeunits can implement the interface, contradicting the purpose of interfaces as general contracts.

How to fix it

Remove the Scope attribute from the interface method declaration. If you need scope restrictions, apply them on the implementing codeunit's methods instead.

Example of code that triggers AL0919

interface IMyInterface
{
    [Scope('OnPrem')]
    procedure DoWork();
}

Example of how to fix it

Remove the Scope attribute from the interface method.

interface IMyInterface
{
    procedure DoWork();
}

Getting started with AL
Developing extensions
Interfaces in AL