# Compiler Error AL0922
> 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 https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb. To read about contributing, see Contribute to the Help<../../help/contributor-guide#contributing>. Thanks!
The method '{0}' cannot be used as the implementation for the interface method '{1}' because it has 'OnPrem' scope.
## Description
Interface implementations cannot have OnPrem scope because interfaces can be invoked in cloud environments where OnPrem methods are not available.
## Remarks
Interface methods can be called from any environment, including cloud (SaaS). A method marked with `[Scope('OnPrem')]` is only available in on-premises deployments. If such a method implements an interface, calling the interface from a cloud environment would fail at runtime.
## How to fix it
Remove the `[Scope('OnPrem')]` attribute from the implementing method. If the method contains on-premises-only logic, refactor it so the interface implementation works in all environments.
## Example of code that triggers AL0922
```al
interface IDataExporter
{
    procedure Export(data: Text);
}

codeunit 50100 FileExporter implements IDataExporter
{
    // Error: OnPrem method cannot implement an interface method.
    [Scope('OnPrem')]
    procedure Export(data: Text);
    begin
        // File I/O that only works on-premises
    end;
}
```
## Example of how to fix it
Remove the OnPrem scope and use cloud-compatible APIs, or redesign your feature.
```al
interface IDataExporter
{
    procedure Export(data: Text);
}

codeunit 50100 FileExporter implements IDataExporter
{
    procedure Export(data: Text);
    var
        TempBlob: Codeunit "Temp Blob";
    begin
        // Use cloud-compatible approach
    end;
}
```
## Related information
Getting started with AL<../devenv-get-started>
Developing extensions<../devenv-dev-overview>
../devenv-interfaces-in-al

Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/diagnostics/diagnostic-al922, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact. https://jonas-paprotka.de/docs/dev-itpro/developer/diagnostics/diagnostic-al922/
